Hi Everybody,
I have searched all over for an answer to this problem, but have had no luck. I’m hoping you can help. I have set up a gallery of graphic design work. I want to be able to click on a small version of each piece in the gallery and have it “grow” into a larger version. Then when that larger version is clicked, I want it to shrink back down and return to the submenu.
I have been able to make it so that when the small version is clicked, it loads a swf of that piece“growing” into the larger version. And when the larger piece is then clicked, the timeline jumps to another keyframe on the swf and “shrinks” the piece.
What I would like to happen is that when the swf reaches the last frame, it jumps to the submenu on the main timeline, but I’m having trouble making the timeline of the loaded swf communicate with the main timeline.
I think the problem has to do with adding the Child to the stage, but if I don’t add the swf to the stage, it doesn’t show up.
Thanks so much in advance for your help!
Here is the code:
//This loads the swf file that shows the piece enlarging and shrinking.
var requestBigEngine:URLRequest = new URLRequest(“bigEngine.swf”);
var bigLoader:Loader = new Loader();
bigLoader.load(requestBigEngine);
//This listens for the completion of the load of the swf and starts the function “bigEngineLoaded” which puts the swf on the stage and makes a movie clip (bigEngineMC) out of the loaded swf so its timeline can be controlled.
bigLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, bigEngineLoaded);
function bigEngineLoaded(myevent:Event):void {
var bigEngineMC:MovieClip=myevent.target.content;
stage.addChild(bigLoader);
}
//When the enlarged piece is clicked, it “shrinks” and the viewer is returned to the submenu
bigEngineMC.addEventListener(MouseEvent.CLICK, gobacktoSubMenu0_0);
function gobacktoSubMenu0_0(evt:Event):void {
bigEngineMC.gotoAndPlay("engineShrink");
}
//This is what doesn’t work:
if (bigEngineMC.currentLabel == "gobacktoSubMenu0_0") {
parent.gotoAndPlay("printSub0_0");
bigLoader.unload();
}
}