4 Replies Latest reply on Aug 19, 2009 10:09 PM by onditz

    Timer and ArgumentError: Error #1063: Argument count mismatch Expected 0, got 1.

    onditz

      Hello,

       

      I'm trying to implement a timer that after noone touches the screen for 5 minutes executes a function. I'm getting  ArgumentError: Error #1063: Argument count mismatch Expected 0, got 1. every time that the timers try to reset. A litle bit of code:

       

      public var myTimer:Timer = new Timer(300000);

       

      public function initMouseListener():void{// I set this function on the application CreationComplete
          this.addEventListener(MouseEvent.CLICK,restartHomeTimer);
      }

       

      public function restartHomeTimer():void{
          myTimer.reset();   
      }

       

      public function homeTimerStart():void{ // I set this function on the application CreationComplete
          myTimer.addEventListener(TimerEvent.TIMER, myEvent);
          myTimer.start();
      }

       

      public function myEvent(evt:TimerEvent):void{
          doStuff();
          myTimer.removeEventListener(TimerEvent.TIMER,myEvent);
      }

       

      Can anyone see a way of solve the problem?

       

      Thank you,

      Onditz