Skip to main content
Inspiring
May 8, 2008
Question

TimerEvent ... how does it get instantiated

  • May 8, 2008
  • 1 reply
  • 296 views
hello;

var mcm_A : Function = function( argo_event : TimerEvent )
{ trace("mcm_A");
} ;

var lvo_timer_A : Timer = new Timer( 1000 );
lvo_timer_A.addEventListener( TimerEvent.TIMER , mcm_A ) ;
lvo_timer_A.start();


this works fine but I am not sure I understand why TimerEvent.TIMER is firing;

is it only firing because it has a Timer registered to it ??

or does it always just keep firing every single millisecond and then check to see if at that ms there exists a registered Timer that it should callback?


any thoughts?

thanks
dsdsdsdsd
This topic has been closed for replies.

1 reply

kglad
Community Expert
Community Expert
May 8, 2008
your timer is set-up to fire every 1000 ms (in your constructor). you define a listener function to respond to its firing in your addEventListner method. and you start it firing when you apply the start() method.

i don't know if your timer is doing anything if you eliminate your addEventListener() method and include the constructor and start() method.