You need to add your event listener to each of the components as they
are created.  Flex 1.5 doesn't have real bubbling support so you need to
add the listener to each object.  so you may need to iterate through the
array and add a listener to each item in there.
 
Matt

________________________________

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Dave Turner
Sent: Friday, June 08, 2007 2:50 PM
To: [email protected]
Subject: [flexcoders] Flex 1.5 dispatchEvent and addEventListener
question



Hello 

I am working on a 1.5 project and i have an mxml page that creates an
Array of Components. These Components are basically a Container that
holds a few form elements. 

if one of these components dispatches an event how would i set up the
parent page to listen for the dispatched event?

I have been able to successfully capture an event when i utilize the
"id" attribute of the component but because its an array of objects in
this case i cannot do that. 

for instance i cannot do this.. 
thing.addEventListener("eventThrown", Delegate.create(this, onEvent));

Ive tried referencing the Repeater that generates the Array of Objects
but that does not detect the event.. 

I know this wouldn't be a problem in 2.x but I am unable to get the
parent to detect the thrown event in 1.5.

Any help with this matter would be greatly appreciated.

thanks, 
Dave 



 

Reply via email to