Guys,

I have a small query regarding the event propagation. The sample code is
mentioned below.

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"; layout="absolute"
creationComplete="onCC()">
<mx:Script>
    <![CDATA[
        private function onCC():void
        {
            myPanel.addEventListener(MouseEvent.CLICK, myPanelClickCap,
true);
            myPanel.addEventListener(MouseEvent.CLICK, myPanelClick);
            myHbox.addEventListener(MouseEvent.CLICK, myHboxClickCap ,true);
            myHbox.addEventListener(MouseEvent.CLICK, myHboxClick);
            myButton.addEventListener(MouseEvent.CLICK, myButtonClickCap,
true);
            myButton.addEventListener(MouseEvent.CLICK, myButtonClick);
        }
        private function myPanelClickCap(e:MouseEvent):void
        {
            trace("MyPanelCap::eventcurrtag::"+ e.currentTarget +
":::eveTarget:::"+e.target);
        }
        private function myPanelClick(e:MouseEvent):void
        {
            trace("MyPanel::eventcurrtag::"+ e.currentTarget +
":::eveTarget:::"+e.target);
        }
        private function myHboxClickCap(e:MouseEvent):void
        {
            trace("MyHBoxCap::eventcurrtag::"+ e.currentTarget +
":::eveTarget:::"+e.target);
        }
        private function myHboxClick(e:MouseEvent):void
        {
            trace("MyHBox::eventcurrtag::"+ e.currentTarget +
":::eveTarget:::"+e.target);
        }
        private function myButtonClickCap(e:MouseEvent):void
        {
            trace("MyButtonCap::eventcurrtag::"+ e.currentTarget +
":::eveTarget:::"+e.target);
        }
        private function myButtonClick(e:MouseEvent):void
        {
            trace("MyButton::eventcurrtag::"+ e.currentTarget +
":::eveTarget:::"+e.target);
        }


    ]]>
</mx:Script>
    <mx:Panel id="myPanel">
        <mx:HBox id="myHbox">
            <mx:Button id="myButton"/>
        </mx:HBox>
    </mx:Panel>
</mx:Application>

As you all can see the sample code, i have mentioned event listners for both
(capturing phase as well as bubbling phase. )

Now according to the event propagation cycle, in the targetting phase
currentTarget and Target properties are set. But in this example even in the
capturing phase both values come fine.

Please explain why this is happening?
-- 
Regards,
Nishant Mistry
+91-9325671183
E-mail: [email protected]

-- 
You received this message because you are subscribed to the Google Groups "Flex 
India Community" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/flex_india?hl=en.

Reply via email to