In the root, I have 2 buttons that when you press the first one, it goes to the first frame inside the movieclip, if I press the second button it goes to the second frame.
I have the following function in frame 2 inside a movieclip.
function loadMap(mapBoolean:Boolean):void{
if(mapBoolean == false){
var loader:Loader = new Loader();
loader.load(new URLRequest("1.png"));
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadComplete);
function loadComplete(e:Event){
map_holder.addChild(loader);
MovieClip(root).mapLoaded = true;
}
}
}
Var declared: var mapLoaded:Boolean = false;
Button #2 function:loadMap(mapLoaded);
When I first press button #2 it goes to the second frame in the movieclip, it successfully loads the image into the holder. Then I press button #1 to return to the first frame and press button #2 to go to the second frame, and the image is gone. Why is this happening?