I need to load a swf file into a new swf movie. I need to check last frame to start a movie clip, etc. Everything works ok in the below code. I was using as3 and was loading also an external as3 swf movie. The problem started when I tried to load external as2 swf movies as I receive the message: TypeError: Error #1034: Type Coercion failed: cannot convert flash.display::symbol_name to flash.display.MovieClip
. Is there a way I can convert the following code to as2???? Is there another way? Please note I'm an absolute Flash beginner and I've tried my hardest to do this in as3 and now I don't see any alternative but to use as2!!! Many thanks!
var swfLoader:Loader = new Loader();
var swfFile:URLRequest = new URLRequest("file.swf");
var container:MovieClip= new MovieClip();
swfLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, swfLoadedHandler);
var currentSWF:MovieClip = new MovieClip();
swfLoader.load(swfFile);
container.addChild(swfLoader);
addChild(container);
function swfLoadedHandler(e:Event):void {
currentSWF = MovieClip(swfLoader.content);
currentSWF.addEventListener(Event.ENTER_FRAME, checkLastFrame);
function checkLastFrame(e:Event):void {
if (currentSWF.currentFrame == currentSWF.totalFrames) {
currentSWF.stop();
bob.play();
if (bob.currentFrame == 2) {
bob.stop();
}
}
}
}