Flash tutorials | Flash video tutorials | Flash actionscript | flash animation | flash menu | flashconf.com Flash tutorials, Flash video tutorials, Flash actionscript, flash animation , flash menu

13Feb/100

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.

7Feb/100

Circular Dynamic Preloader Tutorial

Circular Dynamic Preloader Tutorial - Flash ActionScript 3.0 Website Content Loader