It's possible.
Main.mxml
//script
private function init():void{
child1.addEventListener("change", callBackFunction);
}
private function dispatchEventsToChildren():void{
//call this to dispatch an event
dispatchEvent(new Event("change"));
}
//or do it this way
private function controlChildren(event:ItemClickEvent):void{
child1.publicFunctionUpdateData(args);
}
//body
<com:child1 id="child1"/>
<mx:DateField change="controlChildren(event)"/>
Child1.mxml
Some component you have...
--- In [email protected], "brett.hitzel" <[EMAIL PROTECTED]>
wrote:
>
> Hi Everyone,
>
> I have been charged to architect a fairly large scale Flex application
> (first time doing so). I don't think that my issue warrants code
> samples however if needed I can provide.
>
> I have not worked with events too much, but I understand the default
> three phases it goes through (capture,target,bubble). The application
> will be comprised of an application which load a custom MXML component
> (basically an extended Canvas), which in turn loads modules based on
> user interaction. What I need to have happen, is when the root
> (parentApplication) has values that update, I would like for it to
> dispatch an event, which the Modules listen for, and then in response
> poll the parent for that data to get the new information.
>
> Based on everything I have read, events don't propigate in that
> direction (it climbs down the chain from the top, hits the target, and
> then climbs back up). However, is it possible to make it go the other
> way? Can children hear events of the parent? If this is impossible,
> does anyone have any thoughts or suggestions for an alternative to my
> particular problem?
>
> I appreciate any advice you can offer!
>