Skip to main content
Participant
September 21, 2007
Question

remote shared object doesn't want to load!

  • September 21, 2007
  • 1 reply
  • 311 views
Hiya, I have created my persistent remote shared object, I can see the fso file created in my the server, and my string is on it. But for some reason it just doesn't like loading up...

If I use getLocal if works fine... Maybe one of you have a fresh pair of eyes!?
If you can, please give us a hand. Cheers

// 1 - connecting, and storing one string in my remote shared object ----

var my_nc:NetConnection = new NetConnection();

my_nc.connect("rtmp://myDomain");
var my_so:Object = new Object();
my_so = SharedObject.getRemote("testSo", my_nc.uri, true);

my_so.connect(my_nc);

my_so.data.aString = "a testing string";

/// making sure it's saved.
my_so.data.aString.flush();
// or: my_so.data.flush(); - both gave the same result

//I can see it fine now
trace(my_so.data.aString);

// 2 - connecting, and TRYING to load my string from my_so ----

var my_nc:NetConnection = new NetConnection();

my_nc.connect("rtmp://myDomain");
var my_so:Object = new Object();
my_so = SharedObject.getRemote("testSo", my_nc.uri, true);

my_so.connect(my_nc);

// I can see nothing (undefined)! but aString is stored in testSo.fso in my server...
trace(my_so.data.aString);
    This topic is closed to new replies. Start a new post to keep the conversation going.

    1 reply

    Inspiring
    September 23, 2007
    I made it use localhost as the path to the .swf so you might want to change the net connection uri property to the application directory if you are testing on a webhosts domain.


    [/code]
    var my_nc:NetConnection = new NetConnection();

    my_nc.connect("rtmp:/myDomain/mySwf");

    my_so = SharedObject.getRemote("testSo", my_nc.uri, true);

    my_so.connect(my_nc);

    my_so.data.aString = "a testing string";

    /// making sure it's saved.


    //I can see it fine now
    trace(my_so.data.aString);



    var my_nc:NetConnection = new NetConnection();

    my_nc.connect("rtmp:/myDomain/mySWF");
    my_so = SharedObject.getRemote("testSo", my_nc.uri, true);

    my_so.connect(my_nc);

    trace(my_so.data.astring);

    [/code]