Welcome to TalkGraphics.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Feb 2001
    Location
    Vancouver, BC, Canada.
    Posts
    55

    Default

    I have created a Shared Object in "a.swf". I can read and write to it -no problem, but how do I access it from a movie "b.swf".

    If in "b.swf" I use:

    so = sharedobject.getLocal("savedPrefs");
    myTextfield.text=so.data.thevar;

    ...Nothing happens!

    Or when trying to indicate the path to the movie which created the SharedObject:

    so = sharedobject.getLocal("savedPrefs","/dir/a.swf");
    myTextfield.text=so.data.thevar;

    -same result.

    Anybody got this to work?

    Again, I need to access my SharedObject not from the movie I created it in but from a DIFFERENT one.
    Any help would be much appreciated
    IP

  2. #2
    Join Date
    Feb 2001
    Location
    Vancouver, BC, Canada.
    Posts
    55

    Default

    I have created a Shared Object in "a.swf". I can read and write to it -no problem, but how do I access it from a movie "b.swf".

    If in "b.swf" I use:

    so = sharedobject.getLocal("savedPrefs");
    myTextfield.text=so.data.thevar;

    ...Nothing happens!

    Or when trying to indicate the path to the movie which created the SharedObject:

    so = sharedobject.getLocal("savedPrefs","/dir/a.swf");
    myTextfield.text=so.data.thevar;

    -same result.

    Anybody got this to work?

    Again, I need to access my SharedObject not from the movie I created it in but from a DIFFERENT one.
    Any help would be much appreciated
    IP

  3. #3
    Join Date
    Aug 2000
    Location
    Toronto, Ontario, Canada
    Posts
    432

    Default

    can you supply us with the code you're using to set the sharedObject? the retrieval code looks okay to me...


    hth,
    Deep (just a guy)
    <font face="arial" size="2">
    Pradeep Kumar Nair, B.Math
    Interactive Developer
    http://www.bluespark.com
    ICQ: 39102360
    </font>
    hth,
    Deep (just a guy)
    --
    Pradeep Kumar Nair, B.Math
    CTO
    9 Story Entertainment
    http://www.9story.com
    IP

  4. #4
    Join Date
    Feb 2001
    Location
    Vancouver, BC, Canada.
    Posts
    55

    Default

    Thanks for the reply Deep.
    Here is the problem:
    There is a Flash web app. on an ASP page. It retrieves a variable from the page URL and sends it to the Flash movie like this:

    <embed src="edit_time_t.swf?ID=<%=Request.QueryString["ID")%>"

    Then Flash retrieves some data from a database according to this var.
    I'd like to be able to store user preferences in SharedObject but the problem is as soon as I add the '?ID=<%=Request.QueryString["ID")%>"' Flash doesn't recognize it as a SharedObject created by this movie.

    As a workaround I am trying to make this SO available to all swf-s in the directory no matter which file has created it. MM online documentation says that the only way to go is to indicate the "locatPath" parameter in getLocal().
    Well, I did. Still doesn't help.

    Here is the code:

    //For "a.swf":
    so = sharedobject.getLocal("savedPrefs");
    so.data.thevar=myTextfield.text;
    so.flush();

    //then I can access my so in the same movie when the page is reloaded:

    indicator.text=so.data.thevar;

    The problem is when I try to do access it from a different movie (see first posting) it doesn't work.

    If you have a working example of accessing SO by a movie that didn't create it please let me know.

    Thanks!
    IP

  5. #5
    Join Date
    Aug 2000
    Location
    Toronto, Ontario, Canada
    Posts
    432

    Default

    Sorry 'bout the long wait in a response - been swamped at work. Did you embed the movies in an HTML page? The Shared Objects are attached to a domain, so if the movie doesn't know which domain to check, it may not retrieve the Shared Object. If it has been embedded in a site with a domain, then I'll have to do more research. [img]/infopop/emoticons/icon_redface.gif[/img]


    hth,
    Deep (just a guy)
    <font face="arial" size="2">
    Pradeep Kumar Nair, B.Math
    Interactive Developer
    http://www.bluespark.com
    ICQ: 39102360
    </font>
    hth,
    Deep (just a guy)
    --
    Pradeep Kumar Nair, B.Math
    CTO
    9 Story Entertainment
    http://www.9story.com
    IP

 

 

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •