PDA

View Full Version : SharedObject issue


rafnews
02-21-2008, 06:49 AM
Hi,

i have a crazy issue with ShareObject.
my preloader retrieve data from FlashVar and should forward them (thanks ShareObject) to my main swf file.

however, the main movie/swf file, receive no data as ShareObject.

here is the code of my preloader:

// retrieve data from FlashVars
var lng = root.loaderInfo.parameters.lng;
var theme = root.loaderInfo.parameters.theme;

//create the local Shared Object
var mySo:SharedObject = SharedObject.getLocal("Settings");
var SoResult;

if(lng != null && theme != null)
{
mySo.data._lg = lng;
mySo.data._theme = theme;
SoResult = mySo.flush();
}


here is my main mvie/swf file code which retrieve this ShareObject:

//create the local Shared Object
var mySo:SharedObject;
mySo = SharedObject.getLocal("Settings");
var lg:String;
var theme:String;

if(mySo.data._lg != null && mySo.data._theme != null)
{
lg = mySo.data._lg;
theme = mySo.data._theme;
}


but "lg" is undefined as also "theme" :-(
I've checked if data send to preloader via FlashVars were correctly received by my preloader and it's ok.

So, where could be the problem ?

thanks a lot,

A.

fou99004
02-21-2008, 02:39 PM
You should download Shared Object Reader

http://www.sephiroth.it/python/solreader.php

This will at least help you see if your shared object actually has the data.

rafnews
02-21-2008, 03:21 PM
thanks for info, it helped me to find something very interesting...

I found that my SharedObject data are saved in the following folder:
c:\Documents and Settings\xxxx\Application Data\Macromedia\Flash Player\#SharedObjects\7C83L4FJ\www.mywebsite.com\y yy\xyxy\Preloader.swf\Settings.sol

whereas the main swf file is looking for :
c:\Documents and Settings\xxxx\Application Data\Macromedia\Flash Player\#SharedObjects\7C83L4FJ\www.mywebsite.com\y yy\xyxy\intro_menu.swf\

which is for sure, empty folder.

therefore how can i setup the SharedObject to saved this sol file in c:\Documents and Settings\xxxx\Application Data\Macromedia\Flash Player\#SharedObjects\7C83L4FJ\www.mywebsite.com\f lashcookie\ folder only ?

i tried to setup the path using :

var So:SharedObject;
So = SharedObject.getLocal("Settings", "http://www.mywebsite.com/flashcookie/");


but it does not work.

thanks for help.

A.