Hi AS3 users,
Happy new year!
I'm not very familiar with A3 but I managed to make a scripted animation with the Greensock tweens. But now my client wants me to repeat the animation only a few times. It has to stop on the last frame after 30 secs. But how do I do that? Hope somebody will help me with this.
The file is too big for upload but here is the code:
Cheers, jaswa
import com.greensock.TweenLite; import com.greensock.easing.*; var Mybg1 = new bg1(); var Mybg2 = new bg2(); var Mybg3 = new bg3(); var Mybg4 = new bg4(); var Mybtn = new btn(); addChild(Mybg1); addChild(Mybg2); addChild(Mybg3); addChild(Mybg4); addChild(Mybtn); Mybtn.x = 0; Mybtn.y = 0; // URLRequest variable(where to navigate) var Amexlink:URLRequest = new URLRequest("https://xxxxxx"); // Navigation function function navigateFunc(event:MouseEvent):void { navigateToURL(Amexlink, "_blank"); } // Fire off that event when button is clicked in FLash Mybtn.addEventListener(MouseEvent.CLICK, navigateFunc); Mybg4.x = 0; Mybg4.y = 0; Mybg4.alpha = 0; Mybg3.x = 0; Mybg3.y = 0; Mybg3.alpha = 0; Mybg2.x = 0; Mybg2.y = 0; Mybg2.alpha = 0; Mybg1.x = 0; Mybg1.y = 0; Mybg1.alpha = 1; function animator(target:MovieClip,time:Number,delay:Number,alphaValue:Number,callBack:Function) { TweenLite.to(target,time,{delay:delay,alpha:alphaValue,ease:Back.easeOut, onComplete:callBack}); } var delay:Number = 1; seq1(); function seq1() { animator(Mybg1,2,2,0,null); animator(Mybg2,0,2,1,seq2); } function seq2() { animator(Mybg2,2,2,0,null); animator(Mybg3,0,2,1, seq3); } function seq3() { animator(Mybg3,2,2,0,null); animator(Mybg4,0,2,1, seq4); } function seq4() { animator(Mybg4,0,1,0,null); animator(Mybg1,0,1,1, seq1); }