CODE
var videoList = new Array();
videoList = ["BANNER1.swf","BANNER2.swf","BANNER3.swf"]
var loadFile:String = videoList[Math.floor(Math.random() * 3)]
var l:Loader = new Loader();
l.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, loop);
l.contentLoaderInfo.addEventListener(Event.COMPLETE, done);
l.load(new URLRequest(loadFile));
function loop(e:ProgressEvent):void
{
var perc:Number = e.bytesLoaded / e.bytesTotal;
percent.text = Math.ceil(perc*100).toString();
}
function done(e:Event):void
{
removeChildAt(0);
percent = null;
addChild(l);
}
Is there a way to modify the file to also rotate with a random banner after awhile? Or is there another way to achieve this (it can't be simply rotating image files using PHP, must be a flash component due to limitations with the CMS the host provides plus the banners are already animated in flash format).
Thank you for any help!