0 Replies Latest reply on Feb 27, 2010 1:25 PM by SiHoop

    Timing animations

    SiHoop Level 1

      I'm using a for-loop to place a series of images into a display. I want to have a brief delay that separates the placement of successive images, but cannot figure out how to make the delay. I've tried using a timer object and also I've tried creating a delay with Tweener, but neither work. Can anyone recommend a better approach?

       

      Thank you!

       

      Here's what I've been trying:

       

          for(var j:int=0;j<_currentGoal+1;j++){
              Tweener.addTween( star, {  delay:j*200 , onComplete: doThis });
              //timer = new Timer(200);
              //timer.start();
              function doThis():void{
                      star=new Image
                      star.source=image1;
                      star.x=bottomImage.x+bottomImage.width+(25*(j+1));
                      star.y=bottomImage.y-5;
                      addChild(star)
                      //timer.removeEventListener(TimerEvent.TIMER, doThis)
              }
          }