A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: [RESOLVED] Stopping a Transition from looping AS3

  1. #1
    Member
    Join Date
    Oct 2001
    Location
    Southampton, England
    Posts
    83

    resolved [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.

  2. #2
    :
    Join Date
    Dec 2002
    Posts
    3,518
    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});
    }

  3. #3
    Will moderate for beer
    Join Date
    Apr 2007
    Location
    Austin, TX
    Posts
    6,801
    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.

  4. #4
    Member
    Join Date
    Oct 2001
    Location
    Southampton, England
    Posts
    83
    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
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center