I created an AS3 preloader that loads an external swf in to itself. Code here:
import caurina.transitions.Tweener;
var l:Loader = new Loader();
l.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, preLoop, false, 0, true);
l.contentLoaderInfo.addEventListener(Event.COMPLETE, done, false, 0, true);
l.load(new URLRequest("external.swf"));
var swf:Object = new Object();
function preLoop(e:ProgressEvent):void{
var perc:Number = e.bytesLoaded / e.bytesTotal;
percent.text = Math.ceil(perc*100).toString() + "%";
}
function done(e:Event):void{
Tweener.addTween(loader_mc,
{alpha:0,
time:1,
transition:"easeOutCubic",
onComplete:startGlobe});
removeChildAt(0);
percent = null;
swf = e.target.content;
}
function startGlobe(){
addChild(l);
swf.beginAnimation();
}
Pretty simple. The problem is that on a Mac, the Event.COMPLETE function does not fire once the swf is finished loading. Anyone else run into this situation before?