# What is wrong with this Timer syntax?

**URL:** <https://forum.kirupa.com/t/what-is-wrong-with-this-timer-syntax/249519>\
**Category:** flash\
**Created:** [January 19, 2008, 5:51pm UTC](https://forum.kirupa.com/t/what-is-wrong-with-this-timer-syntax/249519 "2008-01-19T17:51:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![lkingman](https://avatars.discourse-cdn.com/v4/letter/l/cab0a1/32.png) [@lkingman](https://forum.kirupa.com/u/lkingman)\
**Post date:** [January 19, 2008, 5:51pm UTC](https://forum.kirupa.com/t/what-is-wrong-with-this-timer-syntax/249519/1 "2008-01-19T17:51:33Z")

</div>

The Timer takes two parameters as I understand it: duration and repeat. But the compiler returns an error expecting 0 parameters at the new Timer declaration.  
Any help would be greatly appreciated. Thanks.

package {  
import flash.utils.Timer;  
import flash.events.TimerEvent;  
import flash.display.Sprite;

```
public class Timer extends Sprite {

    public function Timer() {
        **var myTimer:Timer = new Timer(2000, 1);**
        myTimer.addEventListener("timer", timerHandler);
        myTimer.start();
    }

    public function timerHandler(event:TimerEvent):void {
        trace("timerHandler: " + event);
    }
}

```

}
