View Full Version : SharedObject offline
lporiginalg
04-23-2008, 08:08 PM
Hi I'm looking for help with flash SharedObject. I've made a couple movies that write to the same sharedObject and it's all working great online from my webserver but now I'm trying to offer a flash project download version of the main movie that would allow them to run it in offline mode but sadly this file when run does not read the sharedObject :(
If anyone knows a solution to this issue I will be very grateful.
Cheers,
lp
SmashingEric
04-23-2008, 08:14 PM
Unfortunately shared objects can only be accessed and written to within the domain of where the flash file lives.
If you look at the folder where your shared objects live, they are created in folders based on directory structure and file name.
For example:
#SharedObjects/JCTEENB7/www.domain.com/dir/myswf.swf/so_name.so
myswf.swf can write a shared object to any of those directories down to www.domain.com (specified in the second parameter of the shared object call).
When you run the file locally, it can only access shared objects in the #localhost or localhost directory.
So long story short (too late), you can't share the shared object between the two apps because flash considers them to live in two different domains.
Not sure if it will help, but here is a thread talking about targeting a directory
http://www.actionscript.org/forums/showthread.php3?t=168390
Again it might not make a difference, never tried online/offline, but worth looking into.
Here is some more interesting info also
http://www.thoughtsabout.net/blog/archives/000003.html
SmashingEric
04-23-2008, 08:25 PM
Here is some more interesting info also
http://www.thoughtsabout.net/blog/archives/000003.html
His workaround might work. However it's four years old and from flash player 7, so they may have removed that loophole in the later releases. But it's worth a shot.
His workaround might work. However it's four years old and from flash player 7, so they may have removed that loophole in the later releases. But it's worth a shot.
Not sure if it will help...... but worth looking into.
Thats why I said those things. Yeah I dont know if it will work but just throwing out ideas that might be worth a shot.
I hope if it does work lporiginalg will comeback and tell us ;):)
lporiginalg
04-23-2008, 08:47 PM
Hey guys thanks for the replies, Eric has confirmed what I already thought to be true which is that it seems essentially impossible.
I had found that other link before posting about the hole in flash player 7 but unfortunately that got nixed in version 8.
I'm using the same thing they already talked about in those other threads which is basically:
mySO = SharedObject.getLocal("test","/");
But it seems like that writes to the relative directory in /#localhost and if u run it locally it writes to /localhost and there doesn't seem to be any way to have the local version read from the 'domain' version.
But if anybody finds out there is a way PLEASE post.
Cheers,
Lyndon
SmashingEric
04-23-2008, 08:51 PM
One potential option would be to use a wrapper program like Zinc, which can read and write to the local file system to manually open and parse the shared object from the domain directory.
It's kind of a long work around, but that's the only other way I can think of.
xxneon
07-10-2008, 03:18 AM
I just tested
projector 1 code..
mySO = SharedObject.getLocal("test", "/");
mySO.data.tester = "test";
mySO.flush();
projector 2 code..
createTextField("txt",0,0,0,4,4);
txt.autoSize = true;
mySO = SharedObject.getLocal("test", "/");
txt.text = mySO.data.tester;
the projectors are even placed in different folders and it works fine.. the second projector is able to display "test" in the textfield.. now this is a projector that is generated from CS3.. not Flash 8.. so maybe the Flash 8 projector is different.. but it seems to work fine with a CS3 projector..
the projectors are even placed in different folders and it works fine.. the second projector is able to display "test" in the textfield.. now this is a projector that is generated from CS3.. not Flash 8.. so maybe the Flash 8 projector is different.. but it seems to work fine with a CS3 projector..
I get the same result in Flash 8 (projector / or SWF + using different folders, locations etc...) Seems to work fine.
|
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.