Make sure you set the bubbles=true when you construct the Event object.
The parent should be able to listen to itself and still see it.
parent.as
class ParentComponent
{
public function ParentComponent()
{
addEventListener("bubbler", bubblerEventHandler);
}
}
child3.as
class Child3
{
private function doSomething():void
{
var event:Event = new Event("bubbler", true);
dispatchEvent(event);
}
}
________________________________
From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Marlon Moyer
Sent: Monday, March 26, 2007 9:26 AM
To: [email protected]
Subject: [flexcoders] Capturing an event in a separate component
Given this scenario:
Parent Componet
Child1
Child2 (child of Child1)
Child3 (child of Child3)
and Child3 dispatches an event, how can I make the parent see that
event without having to pass it up between each child? I've made the
event bubble, but I can't seem to make the parent see it.
I can't seem to get the syntax for the addEventListener correct. Thanks