Is there a way to catch the MouseEvents coming from the VBox and HBox
and cancel the bubble before it gets to my parent Canvas?  I have
checked the currentTarget and the Target and my Canvas object is in
the event when I mouse into the V/HBox, but I can't seem to see the
V/HBox in the event anywhere so I don't see how checking the the
currentTarget is helping.  My mouseOut handler sees that I am mousing
out of my Canvas, but I don't see anywhere in the event showing what
I'm mousing into.  Seems it would be much, much easier if I could
simply capture the mouse events in teh V/Hbox and turn off bubble.  So
I've tried to place mouseOver/Out handlers on them where I
event.stopImmediatePropagation() and also tried
event.stopPropagation() but I guess because of timing it does not work.

Any other advise would be appreciated.

Thanks,
Dale

--- In [email protected], "Deepa Subramaniam" <[EMAIL PROTECTED]>
wrote:
>
> Mouse events bubble. Tou're seeing mouseOver/mouseOut events from the
> HBoxes, VBoxes, UITextFields, etc that are children of the Canvas. You
> can determine if the Canvas is the display object processing the event
> by querying the currentTarget property on the event object. 
> 
> -----Original Message-----
> From: [email protected] [mailto:[EMAIL PROTECTED] On
> Behalf Of dbronk
> Sent: Friday, November 02, 2007 1:37 PM
> To: [email protected]
> Subject: [flexcoders] Why is mouseOut being called?
> 
> I have a very basic Canvas.  It has a VBox that holds some text and
> then under that is a HBox that holds some other test.  The canvas has
> both mouseOver and mouseOut events defined.  I also tried rollOver and
> rollOut and get the exact same thing.  When I move my cursor in
> between the text lines in the top VBox as was as when I move the
> cursor in between the top VBox and the bottom HBox, the mouseOut event
> fires.  Also the rollOut fires when I try that.  Why?  I'm clearly
> withing the Canvas.  Here is the Canvas with some scripts removed...
> 
> Thanks,
> Dale
> 
> <?xml version="1.0" encoding="utf-8"?>
> 
> <mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml";
> xmlns:components="components.*" mouseOver="onMouseOver(event)"
> mouseOut="onMouseOut(event)">
> 
> 
>         <mx:Script>
>                 <![CDATA[
>                         private function
> onMouseOver(event:MouseEvent):void
>                         {
>                                 trace("onMouseOver");
>                         {
>                         
>                         private function
> onMouseOut(event:MouseEvent):void
>                         {
>                                 trace("onMouseOut");
>                         }
>                 
>                 ]]>
>         </mx:Script>
> 
>         <mx:VBox width="100%" paddingLeft="10">
>                 <mx:Text id="listingNameText" text="{listing.title}"
> width="100%" height="24" styleName="resultTitle" />
>                 <mx:Text id="listingLocation" text="{listing.city},
> {listing.state}" width="100%" height="13.5" styleName="resultCity" />
>                 <mx:Text id="listingDesc" text="{listing.description}"
> width="100%" height="25" styleName="resultDesc" />
>         </mx:VBox>
>         <mx:HBox id="listingDollars" width="100%" horizontalGap="0"
> height="18" bottom="0" paddingLeft="10">
>                 <mx:HBox horizontalGap="0" width="30%">
>                         <mx:Text text="CF:" styleName="resultFinHead"
> width="15"/>
>                         <mx:Text text="{
> usdFormatter.format(StringUtils.nullToBlank(listing.cashFlow)) }"
> styleName="resultFinValue" width="60" height="18"/>
>                 </mx:HBox>
>                 <mx:HBox horizontalGap="0" width="30%">
>                         <mx:Text text="R:" styleName="resultFinHead"
> width="15"/>
>                         <mx:Text text="{
> usdFormatter.format(StringUtils.nullToBlank(listing.revenue)) }"
> styleName="resultFinValue" width="60" height="18"/>
>                 </mx:HBox>
>                 <mx:HBox horizontalGap="0" width="40%">
>                         <mx:Text text="A:" styleName="resultFinHead"
> width="15"/>
>                         <mx:Text text="{
> usdFormatter.format(StringUtils.nullToBlank(listing.price)) }"
> styleName="resultFinValueSorted" width="60" height="18"/>
>                 </mx:HBox>
>         </mx:HBox>
> 
> </mx:Canvas>
> 
> 
> 
> 
> 
> 
> --
> Flexcoders Mailing List
> FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> Search Archives:
> http://www.mail-archive.com/flexcoders%40yahoogroups.com 
> Yahoo! Groups Links
>


Reply via email to