Re: [flexcoders] Event Best Practices
As long as the component are oon the display list and the event bubbles property is set to true you can listen for the event in the main app. However you can catch the event in every component nested in the main app which parents the component that dispatched the event... THT, C From: jdizowat To: flexcoders@yahoogroups.com Sent: Friday, August 14, 2009 6:48:52 PM Subject: [flexcoders] Event Best Practices Super Noob Question Incoming - So if I my application looks like the following - That deepest custom component dispatches an event and I would like that event to make it to the application level. Is that even normal to have components that nested? Thanks for any insight, Jason
RE: [flexcoders] Event Best Practices
Look at adding event metadata. If you add an event called myCustomEvent in the metadata and dispatch it from the inner component, you are able to handle it from the outer component like this: That's the easy way to do it. If you have multiple levels of nesting, I've found it easiest to use a Model Singleton that extends EventDispatcher and dispatch the events and listen to the events through the model. That's the more complicated way to handle it. Jake Churchill CF Webtools 11204 Davenport, Ste. 100 Omaha, NE 68154 <http://www.cfwebtools.com> http://www.cfwebtools.com 402-408-3733 x103 From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of jdizowat Sent: Friday, August 14, 2009 10:49 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Event Best Practices Super Noob Question Incoming - So if I my application looks like the following - That deepest custom component dispatches an event and I would like that event to make it to the application level. Is that even normal to have components that nested? Thanks for any insight, Jason No virus found in this incoming message. Checked by AVG - www.avg.com Version: 8.5.392 / Virus Database: 270.13.56/2302 - Release Date: 08/14/09 06:10:00
RE: [flexcoders] Event Best Practices
Maybe it's just me . but I usually stick all my custom components in separate files. As long As you import them correctly in the main app, you should be able to bubble events up. -jake _ From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of jdizowat Sent: Friday, August 14, 2009 8:49 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Event Best Practices Super Noob Question Incoming - So if I my application looks like the following - That deepest custom component dispatches an event and I would like that event to make it to the application level. Is that even normal to have components that nested? Thanks for any insight, Jason
[flexcoders] Event Best Practices
Super Noob Question Incoming - So if I my application looks like the following - That deepest custom component dispatches an event and I would like that event to make it to the application level. Is that even normal to have components that nested? Thanks for any insight, Jason