all groups > macromedia flash flashcom > september 2007 >
You're in the

macromedia flash flashcom

group:

remote shared object doesn't want to load!


remote shared object doesn't want to load! Mario Vieira
9/21/2007 1:36:26 AM
macromedia flash flashcom:
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);
Re: remote shared object doesn't want to load! calmchess333
9/23/2007 1:10:30 PM
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]


AddThis Social Bookmark Button