controlling external swf file timeline
Hi everybody
I have a simple question but I can't solve that my self and appreciate any help.
I have two frames:
1: two buttons to load different swf files in the second frame
2: the second frame in which the swf files are loaded. and of course there is a button to go back frame 1; and some buttons to control swf timeline;
so they're loaded in the second frame very well, and using the back button I can go back frame 1 as well, but in the second frame I have some buttons to control the loaded swf, and have certain functions for them, but the buttons don't work
here is my code in frame 1:
import flash.events.MouseEvent;
import flash.display.Loader;
import flash.net.URLRequest;
stop();
var myLoader: Loader = new Loader();
load_btn.addEventListener(MouseEvent.CLICK, myLoad);
function myLoad(evt: MouseEvent): void
{
gotoAndStop("loadingPage");
myLoader.load(new URLRequest("test-movie.swf"));
loader.addChild(myLoader);
}
load_btn2.addEventListener(MouseEvent.CLICK, myLoad2);
function myLoad2(evt: MouseEvent): void
{
gotoAndStop("loadingPage");
myLoader.load(new URLRequest("test-movie2.swf"));
loader.addChild(myLoader);
}
and here is my code in frame 2:
import flash.events.MouseEvent;
import flash.events.Event;
addEventListener(Event.ENTER_FRAME, swfLoaded);
var currentSWF:MovieClip = MovieClip(loader.content);
function swfLoaded(evt:Event):void
{
function button_forward(e:Event):void{
currentSWF.nextFrame();
}
function button_rewind(e:Event):void{
currentSWF.prevFrame();
}
function button_pause(e:Event):void{
currentSWF.stop();
}
function button_play(e:Event):void{
currentSWF.play();
}
}
back_btn.addEventListener(MouseEvent.CLICK, goHome);
function goHome(evt:MouseEvent):void
{
removeChild(loader);
gotoAndStop("home");
}
and there is no errors or warnings, etc. it just doesn't work
I can't find out where my problem is.
Thanks for your help
