If an event "bubbles" you can listen for it in any ancestor, like
Application.application.

 

Look at the docs for the timer event, to se if if bubbles.  If it does
not, in the timer component, re-dispatch an event, setting the second
argument to true, to make it bubble.

 

Tracy

 

________________________________

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of iilsley
Sent: Tuesday, March 27, 2007 11:50 PM
To: [email protected]
Subject: [flexcoders] newbie question: Timer across components..

 


Is it possible to have a Timer in one component and have another
component 
execute a function when that timer fires ?

eg:

Comp1 has a timer set for 3 seconds .. 

In Comp2 I want to 'capture' the TimerEvent.TIMER from Comp1 to execute
a function defined in Comp2..

---
I currently have something working but I kinda feel its just not the
right way .. :) .. 

In Comp2 I have 

Application.application.ti.addEventListener(TimerEvent.TIMER,fired);

where 'ti' is the Timer . 

Is there a better way to listen for the event  ?


Thanks



 

Reply via email to