Hi,
I am using the following code to load 3 external SWF files one after one. I have used the code replied by greensock. As I am new to greensock plug-ins, I have just copied the exact code as below on empty Flash CS4 AS 3 document's first frame. There is nothing on the page.
The code is:
var urls:Array = ["swfs/Logo.swf","swfs/Clock.swf","swfs/AnimatedBanner.swf"];
var curLoader:SWFLoader;
var curSWF:MovieClip;
playSWF(urls[0]);
function playSWF(url:String):void {
if (curLoader != null) {
curSWF = null;
curLoader.dispose(true);
removeEventListener(Event.ENTER_FRAME, checkFrame);
}
curLoader = new SWFLoader(url, {container:this, onComplete:completeHandler});
curLoader.load();
}
function completeHandler(event:LoaderEvent):void {
curSWF = curLoader.rawContent;
addEventListener(Event.ENTER_FRAME, checkFrame, false, 0, true);
}
function checkFrame(event:Event):void {
if (curSWF.currentFrame == curSWF.totalFrames) {
var index:int = urls.indexOf(curLoader.url) + 1;
if (index < urls.length) {
playSWF(urls[index]);
} else {
trace("done with all swfs");
}
}
}