0

Can anyone help me how to access a sharedobject from an swf to another swf? I have a swf file wherein in its second frame, I saved a value through "sharedObject". I have also a .as file wherein I call that value I saved, and pass it to another swf file. I successfully pass the value if I save it in the first frame on the first swf. But the problem is this: If I save it on its second frame, I can't pass the value anymore. I have an idea of just calling the "sharedobject" instead of calling the "Level1.swf"(the name of the 1st swf) but I have no idea how to do it. I don't want to just save the value on the 1st frame either. I really need help. Any help is very much appriciated.

Here's my .as file because I think this is the problem, but I can also post my other codes if requested:

package  
{
import flash.display.Loader;
import flash.display.Sprite;
import flash.events.Event;
import flash.net.URLRequest;


public class Reward1 extends Sprite 
{
   public var loader:Loader;

   public function Reward1()
{
     loader = new Loader();
     loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onLoaded);
     loader.load(new URLRequest("Level1.swf"));

}

public function onLoaded(e:Event):void 
    {
        trace("Child Loaded");
        trace(loader.content['SaveReward1']);

    }

    public function go0():int{

        return loader.content['SaveReward1'];
    }


}
}
user3273190
  • 21
  • 1
  • 6

1 Answers1

0

Just in case you did not founded the answer, I had the same problem, and got the solution here.

At the page I founded the image very useful. All I had to do was to set the secure parameter to false. Example:

var mySharedObject:SharedObject = SharedObject.getLocal("local_name", "/path", false);
rink.attendant.6
  • 44,500
  • 61
  • 101
  • 156
Mario Coin
  • 21
  • 1
  • 4