Definition:
You can instruct any container or control to listen for events dispatched by another container or control. When Adobe ® Flash ® Player dispatches an Eventobject.That EventObject makes a roundtrip journey from the root of the display list to the target node. The targetnode is the node in the display list where the event occurred.
The eventflow is conceptually divided into 3 parts:
- The capturing phase
- The targeting phase
- The bubbling phase
Example:
<?xml version=”1.0″?> <!– events/ShowEventPriorities.mxml –> <mx:Application xmlns:mx=”http://www.adobe.com/2006/mxml” creationComplete=”initApp()”>
<mx:Script>
<![CDATA[ private function returnResult(e:Event):void
{
ta1.text += "returnResult() method called last (priority 1)\n";
}
private function verifyInputData(e:Event):void
{
ta1.text += "verifyInputData() method called first (priority 3)\n";
}
private function saveInputData(e:Event):void
{
ta1.text += "saveInputData() method called second (priority 2)\n";
}
private function initApp():void
{
b1.addEventListener(MouseEvent.CLICK, returnResult, false, 1); b1.addEventListener(MouseEvent.CLICK, saveInputData, false, 2); b1.addEventListener(MouseEvent.CLICK, verifyInputData, false,3);
} ]]>
</mx:Script>
<mx:Button label=”Click Me”/>
<mx:TextArea height=”200″ width=”300″/>
</mx:Application>
Thanks with Regards,
Pandimalar A
