| 12
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 
 | import com.greensock.*; 
import com.greensock.TweenLite;
import com.greensock.easing.*;
import fl.transitions.Tween;
import fl.transitions.easing.*;
import flash.display.Loader;
import flash.events.Event;
 
var chargeur:Loader = new Loader();
 
preloader.fullBeer.mask =  emptyBeerMask;
 
chargeur.contentLoaderInfo.addEventListener(Event.COMPLETE, stopPouring);
chargeur.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, startPouring);
 
function stopPouring(evt:Event):void
{
	removeChild( preloader );
 
	addChild( chargeur );
}
 
function startPouring(evt:ProgressEvent):void
{
	TweenMax.to(emptyBeerMask, 15, {width:500,height:500,ease:Quint.easeOut});
	var pourcentage:int = ( evt.bytesLoaded / evt.bytesTotal ) * 100;
 
	preloader.prct_txt.text = "Chargement : " + pourcentage + "%";
 
	preloader.fullBeer.scaleY = pourcentage / 100;
 
} | 
Partager