I am new at greensock I wanted to see if someone can help me out with this and see if loadermax can do what I need it to do. Below is as3 code to dynamically load in an external .swf from the same directory
the external .swf are named clip0.swf','clip1.swf','clip2.swf
In the main flash i have the as code as followed below.
What I want to accomplish is to load up clip0.swf' dynamically. then when I refresh the page or republish the main file it should show clip1.swf then do it again for clip2.swf. in that order everytime the page refresh the new .swf gets loaded.
the below code randomizes these flashes & works with math.round. but I dont want to randomize the flashes I want it to be in sequence order ( 1,2,3) not 3.1,2 or 2,1,3 I hope this was explained good. I hope someone can help me out. I feel like I have 95% done but cant figure out what I am doing wrong to load these in sequence
----AS3 CODE---------
stop();
var movieArray:Array = ['clip0','clip1','clip2'];
var loader:Loader = new Loader();
var index:int = movieArray.length * Math.random();
var url:String = movieArray[index] + '.swf';
trace("Attempting to load", url);
loader.load(new URLRequest(url));
loader.contentLoaderInfo.addEventListener(Event.CO MPLETE, loaderComplete);
loader.contentLoaderInfo.addEventListener(IOErrorE vent.IO_ERROR, loaderIOError);
addChild(loader);
function loaderComplete(e:Event):void {
trace("Successfully loaded", url);
}
function loaderIOError(e:IOErrorEvent):void {
trace("Failed to load", url);
}