Today if your flash exceed 700 KB (the size of a larger picture), is if you put a Preloader.
Actionscript 3 is very simple in the first frame put the code
this.loaderInfo.addEventListener(ProgressEvent.PROGRESS, onProgress);
this.loaderInfo.addEventListener(Event.COMPLETE, onComplete);
function onProgress(e:ProgressEvent):void{
var loaded:Number = e.target.bytesLoaded;
var total:Number = e.target.bytesTotal;
var pct:Number = loaded/total;
loaderMc.barMc.scaleX = pct;
}
function onComplete(e:Event){
play();
}
Where “loaderMc is a MovieClip that contains another MovieClip” barMc. To make things interesting, “barMc” you put on a mask layer in which you can draw like you want to show your progress bar.




Trackbacks/Pingbacks
[...] Preloader actionscript 3 | Flash tutorials | Flash video | Flash … [...]