Put this code into ur first frame of the animation.
-------------------------------------------------------------------------
import fl.transitions.Tween;
import fl.transitions.TweenEvent;
import fl.transitions.easing.*;
var l:Loader = new Loader();
l.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, loop);
l.contentLoaderInfo.addEventListener(Event.COMPLETE, done);
l.load(new URLRequest("img1.jpg"));
function loop(e:ProgressEvent):void {
var perc:Number = e.bytesLoaded / e.bytesTotal;
percent.text = Math.ceil(perc*100).toString();
}
function done(e:Event):void {
var mytween:Tween = new Tween(l, "scaleX",Strong.easeOut,0,1,3,true);
var mytween2:Tween = new Tween(l,
"scaleY",Elastic.easeOut,0,1,3,true);
removeChildAt(0);
percent = null;
addChild(l);
}
No comments:
Post a Comment