title: My timer isn't stopping and I don't know the reason why - Actionscript 3
body: <p>I have tried everything under the sun and I just can't figure out why my timer refuses to stop running.  If anyone could help, I would be so very grateful!  The cod is below:</p>
  
  <pre><code>package {
  import flash.display.Stage;
  import flash.display.MovieClip;
  import flash.events.Event;
  import fl.transitions.Tween;
  import fl.transitions.easing.*;
  import fl.transitions.TweenEvent;
  import flash.utils.Timer;
  import flash.events.TimerEvent;
  import flash.display.Sprite;
  
  public class Monster extends MovieClip
  {
  
      var X:int;
      var Y:int;
      var dodge:Boolean = false;
      var myTween:Tween;
      var myTimer:Timer = new Timer(1000,0);// 1 second
      var alive:Boolean = true;
      var gameWidth = Main.stage.stageWidth;
  
      public function Monster(X:int, Y:int, whichMonster:Number):void
      {
          myTimer.addEventListener(TimerEvent.TIMER, dodgeAttack);
          if ( whichMonster == 1 )
          {
              myTimer.start();
              trace("Is it running "+myTimer.running);
              level_1(X, Y);
          }
          else if ( whichMonster == 2 )
          {
              myTimer.stop();
              removeEventListener(TimerEvent.TIMER,dodgeAttack);
              trace("Is it still running "+myTimer.running);
              level_2(X, Y);
          }
          else if ( whichMonster == 3 )
          {
              level_3(X, Y);
              trace("Is it running "+myTimer.running);
              myTimer.start();
          }
          else if ( whichMonster == 4 )
          {
              level_4(X, Y);
          }
      }
  
      public function level_1(X:int, Y:int):int
      {
  
          this.x = X;
          this.y = Y;
          return X,Y;
  
      }
      public function level_2(X:int, Y:int):int
      {
          this.x = X;
          this.y = Y;
          //Just hardcode the tweens
          myTween = new Tween(this,"x",Strong.easeOut,this.x,500,1,true);
          myTween.addEventListener(TweenEvent.MOTION_FINISH, onFinish);
          return X,Y;
      }
      public function level_3(X:int, Y:int):int
      {
          this.x = X;
          this.y = Y;
          return X,Y;
      }
  
      public function level_4(X:int, Y:int):int
      {
          this.x = X;
          this.y = Y;
          return X,Y;
      }
  
      function onFinish(e:TweenEvent):void
      {
          myTween.yoyo();
      }
  
      function dodgeAttack(e:TimerEvent):void
      {
          var deflect:int = Math.floor(Math.random() * 5);
  
          if (deflect == 3)
          {
              this.gotoAndPlay(114);
          }
          else
          {
              trace("It Ran ");
          }
      }
  </code></pre>
  
  <p>Any help would be appreciated!  Thanks!</p>