Preloader actionscript 3
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.
Similar Posts:
- Simple PreLoader in as3
- Create Basic Flash Preloader
- How to load an image from PC in flash with actionscript 3
- How to create Flash Bubble effect
- How to Create ActionScript 3.0 Events
- ActionScript 3 Drawing API
- AS3 mouse follow
- Flash drawing effect
- How to make flash rotating spiral
- How to Add scrolls to textboxes with ActionScript 3.0
[...] Preloader actionscript 3 | Flash tutorials | Flash video | Flash … [...]