# Timer event with extra params

**URL:** <https://forum.kirupa.com/t/timer-event-with-extra-params/265996>\
**Category:** flash\
**Created:** [July 15, 2008, 10:52am UTC](https://forum.kirupa.com/t/timer-event-with-extra-params/265996 "2008-07-15T10:52:04Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![tensaix2j](https://avatars.discourse-cdn.com/v4/letter/t/13edae/32.png) [@tensaix2j](https://forum.kirupa.com/u/tensaix2j)\
**Post date:** [July 15, 2008, 10:52am UTC](https://forum.kirupa.com/t/timer-event-with-extra-params/265996/1 "2008-07-15T10:52:04Z")

</div>

When using the timer , with timer event…

```auto

var my_timer:Timer = new Timer(1500, 1);
my_timer.addEventListener(TimerEvent.TIMER, dispatch );

function dispatch(&#12288;&#65349;&#65366;&#65349;&#65358;&#65364;&#65306;&#65332;&#65353;&#65357;&#65349;&#65362;&#65317;&#65366;&#65349;&#65358;&#65364;&#65289;{

}

```

how do i pass in extra parameters???

---

<div class="post-metadata">

**Author:** ![sekasi](https://avatars.discourse-cdn.com/v4/letter/s/5f8ce5/32.png) [@sekasi](https://forum.kirupa.com/u/sekasi)\
**Post date:** [July 15, 2008, 12:26pm UTC](https://forum.kirupa.com/t/timer-event-with-extra-params/265996/2 "2008-07-15T12:26:10Z")

</div>

Gotta make your own event that extends the timerevent.

---

<div class="post-metadata">

**Author:** ![senocular](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/senocular/32/7217_2.png) [@senocular](https://forum.kirupa.com/u/senocular)\
**Post date:** [July 15, 2008, 12:32pm UTC](https://forum.kirupa.com/t/timer-event-with-extra-params/265996/3 "2008-07-15T12:32:00Z")

</div>

[QUOTE=sekasi;2358920]Gotta make your own event that extends the timerevent.[/QUOTE]

You’d have to make you’re own class to dispatch it as well. You might be able to get away with a Timer subclass which overrides dispatchEvent. If for some reason that doesn’t work, you’ll need to compose a timer instance into a subclass of EventDispatcher and listen for those events to have your subclass dispatch its own event.

---

<div class="post-metadata">

**Author:** ![sekasi](https://avatars.discourse-cdn.com/v4/letter/s/5f8ce5/32.png) [@sekasi](https://forum.kirupa.com/u/sekasi)\
**Post date:** [July 15, 2008, 2:53pm UTC](https://forum.kirupa.com/t/timer-event-with-extra-params/265996/4 "2008-07-15T14:53:36Z")

</div>

> [@amarghosh;2358922](#):
>
> u cannot pass extra parameters to event handlers. u need to use private variables for that;

No, that’s not true. You can make your own events that can pass parameters. I wasn’t quite sure about the Timer however, but listen to Senocular the ubiquitous AS evangelist :sen:

😃
