-
[RESOLVED] Stopping a Transition from looping AS3
Hi,
Bascially Im trying to stop a transition from looping my code is the following,
import fl.transitions.*;
import fl.transitions.easing.*;
///hide imgs////
img_1_Mc.visible=false;
//timer for img 1////
var timer1:Timer=new Timer(2010);
timer1.addEventListener(TimerEvent.TIMER, onTimer1);
timer1.start();
function onTimer1(evt:TimerEvent):void {
img_1_Mc.visible=true;
var myTM:TransitionManager=new TransitionManager(img_1_Mc);
myTM.startTransition({type:Photo, duration:0.8});
}
Any help would really appreciated.
-
Code:
function onTimer1(evt:TimerEvent):void {
evt.currentTarget.removeEventListener(TimerEvent.TIMER, onTimer1);
img_1_Mc.visible=true;
var myTM:TransitionManager=new TransitionManager(img_1_Mc);
myTM.startTransition({type:Photo, duration:0.8});
}
-
You could also set the timer to only repeat once, by passing a second argument to new Timer
Code:
var timer1:Timer=new Timer(2010, 1);
otherwise, it will keep going in the background.
-
Thanks guys for the reply....Im just starting to get into AS3 Im no coder by nature....but find very interesting never the less....Im determined to get to some level of understanding it more.
Thanks again.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|