Hi there,
Very simple question. Take a look at the code below. It's a very simple loader with a progress bar. The progress bar is a symbol on the stage called "bar".
All I want is to fade out the bar when it finishes loading, and fade in the image that loads. I've tried a number of approaches without much luck.
var loader: Loader = new Loader();
addChild(loader);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, completeHandler);
function completeHandler(evt:Event):void {
};
loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, progressHandler);
function progressHandler(evt:ProgressEvent):void {
var percent: int = Math.round(evt.bytesLoaded/ evt.bytesTotal * 100);
bar.width = percent;
};
var req:URLRequest = new URLRequest("encs1.jpg");
loader.load(req);
Thanks in advance to anyone who can give me any pointers!