Mouseout event in VBox

I can't seem to detect a mouse event (MouseOut) on an
Accordion menu. I can do it on the TabBar but am not able to do it
on the children. I know I am missing something fundamental here.
The purpose is to make Accordion (id=locations) property
Visible=False when MouseOut occurs on the submenu. Any
enlightenment would be appreciated greatly.
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="
http://www.adobe.com/2006/mxml"
layout="absolute">
<mx:Canvas width="753" height="300"
verticalScrollPolicy="off" horizontalScrollPolicy="off" x="0" y="0"
>
<mx:Script>
<![CDATA[
import mx.events.ItemClickEvent;
import mx.controls.TabBar;
import mx.collections.ArrayCollection;
[Bindable]
public var STATE_ARRAY:ArrayCollection = new
ArrayCollection([
{label:"Home", data:"Home"},
{label:"Locations", data:"Locations"}
public function leavemenu(event:MouseEvent):void
locations.visible=false;
public function testIt(event:MouseEvent):void
if (event.target is Button)
{textarea2.text=textarea2.text + 1;
var index:int =
bar.getChildIndex(DisplayObject(event.target));
var tab:Button = Button(bar.getChildAt(index));
if (tab.label=="Home")
locations.visible=false;
if (tab.label=="Locations")
locations.visible=true;
locations.x=tab.x;
locations.y=bar.height+bar.y-2;
locations.height=locations.numChildren*21;
if (event.target is VBox)
textarea2.text=textarea2.text + 2;
]]>
</mx:Script>
<mx:Canvas x="478" y="93" width="275" height="404"
mouseOver="leavemenu(event)">
</mx:Canvas>
<mx:TabBar width="600" id="bar" x="0" y="72"
mouseOver="testIt(event)"
height="20">
<mx:dataProvider>
{STATE_ARRAY}
</mx:dataProvider>
</mx:TabBar>
<mx:Accordion width="150" id="locations"
visible="false"> <!--21 pixels height per line-->
<mx:VBox label="Bethel, CT" width="100%" height="100%"
mouseOver="testIt(event)">
</mx:VBox>
<mx:VBox label="Branford, CT" width="100%" height="100%"
mouseOver="leavemenu(event)">
</mx:VBox>
</mx:Accordion>
<mx:TextArea x="603" y="74" height="18" width="103"
id="searchbox"/>
<mx:Button x="707" y="74" label="Search" width="46"
height="18" fontFamily="Arial"/>
<mx:TextArea x="327" y="28" id="textarea2"/>
</mx:Canvas>
<mx:Image x="0" y="93" source="images/DSC02878.JPG" />
<mx:TextArea id="textarea1" width="150" x="92" y="546"
visible="true"/>
</mx:Application>

Hi,
The following example uses the vbox mouse wheel event to control the list box selected index, its just a simple test but it shows that vbox can accept the mousewheel event- one small caveat the vbox has to gain the mouse focus which requires it to be clicked on first in this example.
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/halo" minWidth="1024" minHeight="768" creationComplete="appInit()">
<fx:Script>
<![CDATA[
import mx.events.FlexEvent;
import mx.collections.ArrayCollection;
[Bindable] private var myData:ArrayCollection= new ArrayCollection([
{Key:1,state:'ACT',name:'Australian Capital Territory'},
{Key:2,state:'NSW',name:'New South Wales'},
{Key:3,state:'NT',name:'Northern Territory'},
{Key:4,state:'QLD',name:'Queensland'},
{Key:5,state:'SA',name:'South Australia'},
{Key:6,state:'TAS',name:'Tasmania'},
{Key:6,state:'WA',name:'Western Australia'},
{Key:7,state:'VIC',name:'Victoria'}]);
private function appInit(): void
myBox.addEventListener(MouseEvent.MOUSE_WHEEL,mouseScroller);
protected function button1_clickHandler(event:MouseEvent):void
if (lst.height==115) lst.height=300 else lst.height=115;
private function mouseScroller(e:MouseEvent): void
if (e.delta < 0 && lst.selectedIndex > 0) lst.selectedIndex -=1;
if (e.delta > 0 && lst.selectedIndex < myData.length) lst.selectedIndex +=1;
]]>
</fx:Script>
<s:List id="lst" x="113" y="77" width="236" height="115" dataProvider="{myData}" labelField="name"></s:List>
<s:Button x="156" y="48" label="Change Height" click="button1_clickHandler(event)"/>
<mx:VBox x="371" y="48" width="200" height="200" backgroundColor="#726E6E" id="myBox">
</mx:VBox>
</s:Application>

Similar Messages

  • CSS advice for Image scale mouseover/mouseout event

    Hi,
    I'm trying to add CSS to an image to create a mouseover/mouseout event. I just can't seem to get it to work.
    I wan't the the scale of the image to increase to 1.5 on mouseover, then return to 1 on mouseout.
    Any advice on the CSS coding would be greatly apreciated....
    Also how would I make an image hover whilst mouseove?.
    Thanks, Mike

    In mouseover event:
            var escalaX=1.5;
            var escalaY=1.5;
            image.getSymbolElement().css({
                "-webkit-transform":"scaleX(" + escalaX + ")",
                "-moz-transform":"scaleX(" + escalaX + ")",
                "-o-transform":"scaleX(" + escalaX + ")",
                "-ms-transform":"scaleX(" + escalaX + ")"
            image.getSymbolElement().css({
                "-webkit-transform":"scaleY(" + escalaY + ")",
                "-moz-transform":"scaleY(" + escalaY + ")",
                "-o-transform":"scaleY(" + escalaY + ")",
                "-ms-transform":"scaleY(" + escalaY + ")"
    if your image is not a symbol, then you must to use sym.$("image").css(... syntax.
    If you prefer animation and not instantaneous change, you can to see this thread: http://forums.adobe.com/message/5590639

  • MouseOut event seems to cancel Click event

    Im using a state for rollovers of a button, and a state for
    the click of the same button, this causes a problem when the user
    clicks the button. Instead of the click state being activated
    instead i see a brief blinking of the click state and then suddenly
    the app reverts to the mouseOut state, how can I tell FLEX that the
    click event is more important then the mouseOut event?
    EXAMPLE
    <mx:Canvas mouseOver="currentState='rollOver'"
    mouseOut="currentState='rollOut'"
    click="currentState='clicked'">
    in this example, when you click the canvas you will end up at
    the "rollOut" state instead of the "clicked" state but it appears
    the clicked state may be displayed for a brief moment as the app
    kind of blinks before showing the "rollOut" state. Oh and I've
    tried to remove the event listener on click but it doesn't appear
    to be fired as the event listener is not removed. HELP!?!

    "octagonatron" <[email protected]> wrote in
    message
    news:g8feue$iee$[email protected]..
    > Im using a state for rollovers of a button, and a state
    for the click of
    > the
    > same button, this causes a problem when the user clicks
    the button.
    > Instead of
    > the click state being activated instead i see a brief
    blinking of the
    > click
    > state and then suddenly the app reverts to the mouseOut
    state, how can I
    > tell
    > FLEX that the click event is more important then the
    mouseOut event?
    >
    > EXAMPLE
    > <mx:Canvas mouseOver="currentState='rollOver'"
    > mouseOut="currentState='rollOut'"
    click="currentState='clicked'">
    >
    > in this example, when you click the canvas you will end
    up at the
    > "rollOut"
    > state instead of the "clicked" state but it appears the
    clicked state may
    > be
    > displayed for a brief moment as the app kind of blinks
    before showing the
    > "rollOut" state. HELP!?!
    How bout
    mouseOut="currentState!='clicked'?currentState='mouseOut':currentState='clicked'"
    or mouseOut="mouseOutHandler()"
    private function mouseOutHandler():void{
    if (currentState!='clicked') currentState='mouseOut';

  • Is there a way to keep an animation playing for a mouseout event when you start a new one?

    I have some buttons that on mouseover they animate scaling up and on mouseout they scale back down. This is working great except the scenario when a user mouse's over one button then immediately mouse's out to the next button the animation on the first button abruptly stops and the animation starts on the current button. Is there a way to keep the animation playing for the first button AND have the animation play work for the second button?
    I have uploaded a quick demo to illustrate what I mean. Also I've uploaded the project file if anyone can find a solution. Thanks!
    Dropbox - edgeAnimateButtonSample.zip

    You need to create two symbols for these two buttons, so that both can play simultaneously.
    I have created a sample for you @ https://www.dropbox.com/s/e59agt7mr8r785l/newedgeAnimateButtonSample.rar?dl=0
    hth,
    Vivekuma

  • Problem with releater and event handling

    Hi Flex genius,
    I have been struggling for the whole day with a problem connected to repeater.
    I have a text field:
    <mx:Text id="shortText" width="300"  text="{newTeaser.currentItem.shortDescription}" styleName="Scandinavian" fontSize="12"  />
    and a label:
    <mx:Label   id="readMoreLabel" x="13" text="{newTeaser.currentItem.readMore}" color="#3C4593" />
    both inside a  Repeater which fetches from an XML:
    <mx:Repeater id="newTeaser" dataProvider="{eventsData}">
    The Repeater works fine, but I need to add a click on the label id="readMoreLabel" that replace the shortText.text with  {newTeaser.currentItem.longDescription} instead of {newTeaser.currentItem.shortDescription}.
    i am quite new in Flex, so I guess I miss some fundamentals.
    Thanks for your help.
    Max

    This code works, and notice the trace(), you CAN have IDs for the controls in the repeater, and you can access them as an array, though I do not make use of this capability in my solution.
    If this post answers your question or helps, please mark it as such.
    Greg Lafrance - Flex 2 and 3 ACE certified
    www.ChikaraDev.com
    Flex / AIR Development, Training, and Support Services
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
      creationComplete="dataService.send();">
      <mx:Script>
        <![CDATA[
          import mx.rpc.events.ResultEvent;
          import mx.collections.XMLListCollection;
          import mx.controls.Text;
          [Bindable] private var eventsData:XMLListCollection;
          private function dataHandler(evt:ResultEvent):void{
            eventsData = new XMLListCollection(evt.result..item as XMLList);       
          private function clickHandler(evt:MouseEvent):void{
            var txt:Text = VBox(evt.currentTarget.parent).getChildAt(0) as Text;
            for each(var xml:XML in eventsData){
              if(xml.shortDescription == txt.text){
                txt.text = xml.longDescription;
            for each(var obj1:Text in shortText){
              trace("shortText: " + obj1.text);
        ]]>
      </mx:Script>
      <mx:HTTPService id="dataService" url="data.xml" resultFormat="e4x" result="dataHandler(event);"/>
      <mx:Repeater id="newTeaser" dataProvider="{eventsData}">
        <mx:VBox width="100%">
          <mx:Text id="shortText" width="100%"  text="{newTeaser.currentItem.shortDescription}"/>
          <mx:Label id="readMoreLabel" text="{newTeaser.currentItem.readMore}" color="#3C4593"
            click="clickHandler(event);"/>   
        </mx:VBox>
      </mx:Repeater>
    </mx:Application>
    <?xml version="1.0" encoding="utf-8"?>
    <teasers>
      <item>
        <shortDescription>This is short desc one.</shortDescription>
        <readMore>Read More One</readMore>
        <longDescription>This is long desc one.</longDescription>
      </item>
      <item>
        <shortDescription>This is short desc two.</shortDescription>
        <readMore>Read More two</readMore>
        <longDescription>This is long desc two.</longDescription>
      </item>
      <item>
        <shortDescription>This is short desc three.</shortDescription>
        <readMore>Read More three</readMore>
        <longDescription>This is long desc three.</longDescription>
      </item>
    </teasers>

  • Why does URLStream complete event get dispatched when the file is not finished loading?

    I'm writing an AIR kiosk app that every night connects to a WordPress server, gets a JSON file with paths to all the content, and then downloads that content and saves it to the kiosk hard drive. 
    There's several hundred files (jpg, png, f4v, xml) and most of them download/save with no problems.  However, there are two f4v files that never get downloaded completely.  The complete event does get dispatched, but if I compare the bytesTotal (from the progress event) vs bytesAvailable (from the complete event) they don't match up; bytesTotal is larger.  The bytesTotal (from the progress event) matches the bytes on the server. 
    The bytesLoaded in the progress event never increases to the point that it matches the bytesTotal so I can't rely on the progress event either.  This seems to happen on the same two videos every time. The videos are not very large, one is 13MB and the other is 46MB.  I have larger videos that download without any problems.  
    [edit] After rebooting the compter, the two videos that were failing now download correctly, and now it's a 300kb png file that is not downloading completely.  I'm only getting 312889 of 314349 bytes.
    If I paste the url into Firefox it downloads correctly, so it appears to be a problem with Flash/AIR.
    [edit] I just wrote a quick C# app to download the file and it works as expected, so it's definitely a problem with Flash/AIR. 
    Here's the code I'm using:
    package  {
        import flash.display.Sprite;
        import flash.events.Event;
        import flash.events.ProgressEvent;
        import flash.net.URLRequest;
        import flash.net.URLStream;
        [SWF(backgroundColor="#000000", frameRate="24", width="640", height="480")]
        public class Test extends Sprite {
            private var fileSize:Number;
            private var stream : URLStream;
            private var url:String = "http://192.168.150.219/wordpress2/wp-content/uploads/2012/12/John-Butler-clip1.f4v";
            public function Test() {
                if (stage)
                    init();
                else
                    this.addEventListener(Event.ADDED_TO_STAGE, init);
            private function init(e:Event=null):void {
                this.removeEventListener(Event.ADDED_TO_STAGE, init);
                stream = new URLStream();
                stream.addEventListener(ProgressEvent.PROGRESS, onLoadProgress);
                stream.addEventListener(Event.COMPLETE, onLoadComplete);
                stream.load(new URLRequest(url));
            private function onLoadProgress(event:ProgressEvent):void {
                fileSize = event.bytesTotal;
                var percent:Number = event.bytesLoaded / event.bytesTotal * 100;
                trace(percent + "%");
            private function onLoadComplete(event:Event):void {
                trace("loaded", stream.bytesAvailable, "of", fileSize);
                // outputs "loaded 13182905 of 13184365"
                // so why is it "complete" when it isn't finished downloading?

    Thanks for your quick reply !
    I am relatively new to programming so please bear with me on this as I still haven't managed to grasp some of those things that "make perfect sense". If I am setting mouseEnabled to false doesn't that mean that the object no longer gets MouseEvents ?
    If I have understood you correctly then once the mouseEnabled is set to false the btn object is removed from the objects recognizable by the mouse - hence dispatching a mouseout event (and I am guessing here) from the mouse?
    I still don't get it though, if the listeners are set to the object and the object is no longer accessible to the mouse why is the event still being dispatched ?
    I get it that the making of the object unavailable to the mouse causes the "removing" (deactivating) of the object from under the mouse,
      step 1. deactivate object, and  step 2. (as a result of step 1) register the removal of the object.
    but why is the mouse still listening after step 1?
    Even if the action is that of "out" (as in the object is no longer under the mouse) it still is an action isn't it ? so haven't we turned off the listening for actions ?
    I promise I am not trying to drive you crazy here, this is just one of those things that I really want to get to the root of !
    Thanks,

  • VBOX Layout issue with offset of a few pixels for the 2nd and 3rd components.

    The VBox has 2 components, on clicking the toggle label on the left,
    one component is hidden and the other is made visible.
    How does one get rid of the padding at the top when the
    2nd component is displayed.
    At the end of the script are two images with one showing the small padding.
    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                                     xmlns:s="library://ns.adobe.com/flex/spark"
                                     xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600">
              <fx:Script>
                        <![CDATA[
          protected function lblSearch_clickHandler(event:MouseEvent):void
              // TODO Auto-generated method stub
              _Debug("Inside "+functionName());
              if(tabnavDetails.visible == true) {
              tabnavDetails.visible = false;
              tabnavSearchDetails.height = tabnavDetails.height;
              tabnavSearchDetails.width = tabnavDetails.width;
              tabnavDetails.height = 0;
              tabnavDetails.width = 0;
              tabnavSearchDetails.visible = true;
              } else if(tabnavSearchDetails. visible = true) {
              tabnavSearchDetails.visible = false;
              tabnavDetails.height = tabnavSearchDetails.height;
              tabnavDetails.width = tabnavSearchDetails.width;
              tabnavSearchDetails.height = 0;
              tabnavSearchDetails.width = 0;
              tabnavDetails.visible = true;
                        ]]>
              </fx:Script>
              <fx:Declarations>
                        <!-- Place non-visual elements (e.g., services, value objects) here -->
              </fx:Declarations>
              <mx:HBox height="100%" width="100%">
                        <s:Label id="lblSearch" name="lblSearch" buttonMode="true" text="Toggle" color="#2133E4" height="5%" paddingTop="8" click="lblSearch_clickHandler(event)"/>
                        <mx:VBox id="vboxMainBody" name="vboxMainBody" width="80%" height="95%" borderColor="Black"
                                             borderStyle="solid" borderVisible="true" focusColor="#FAFAFA" >
                                  <mx:TabNavigator id="tabnavDetails" name="tabnavDetails" visible="true" borderVisible="true" width="100%" height="100%">
                                            <s:NavigatorContent width="100%" height="100%" label="Media Details" >
                                            </s:NavigatorContent>
                                            <s:NavigatorContent width="100%" height="100%" label="Location and Eyeballs">
                                            </s:NavigatorContent>
                                  </mx:TabNavigator>
                                  <mx:TabNavigator id="tabnavSearchDetails" name="tabnavSearchDetails" visible="false" borderVisible="true" width="0%" height="0%" paddingTop="0">
                                            <s:NavigatorContent width="100%" height="100%" label="Search Details" >
                                            </s:NavigatorContent>
                                            <s:NavigatorContent width="100%" height="100%" label="Location and Eyeballs">
                                            </s:NavigatorContent>
                                  </mx:TabNavigator>
                        </mx:VBox>
              </mx:HBox>
    </s:Application>

    Thank you very much. With so many parameters around and being new to flex, this is not easy. Spent an hour or so and then
    decided to ask for help.
    Appreciate it.
    -Jumroo

  • MouseOver/MouseOut Timing Issue

    I'm having an issue with my MouseOut events not firing if the MouseOver is done too quickly. Does anyone have a workaround for this?
    Details
    I have a menu (shown below) that consists of 8 separate symbols. Each symbol has a MouseOver and MouseOut event to make the buttons look like this when you hover (the mouse in this pic is over the Pricing button):
    I'm using the following two handlers:
    - MouseOver - sym.play("in");
    - MouseOut - sym.playReverse("out");
    The above code works well if you move the mouse over each menu symbol and allow enough time for the MouseOver transition to happen. But if you quickly run the mouse over each button (quicker than the MouseOver transition), the MouseOut events never fire leaving the menu looking like this (I quickly ran the mouse over the first 5 menu items):
    Any thoughts on how to force the MouseOut events to fire even if the MouseOver transitions haven't totally completed? Thanks!

    Hi,
    Replace message() built-ins with SYNCHRONIZE built-in. I know its now exact solution. But try your luck. Let us know the status.
    ~Gouri Sankar

  • Missing Mouse Events

    I’ve noticed that it is possible to miss mouse events
    if you move the mouse very quickly. For example, if you quickly
    move the mouse off a control, you can fairly easily miss the
    MouseOut event. Is there a Best Practice way to get around this?
    Thanks!!

    If you move your mouse quickly over an object, you can fairly
    easily miss the mouseout event. This is especially true if the
    object you are moving the mouse over is fairly small.

  • Overlapping elements and events

    Hello all
    I can't reproduce such scenario in Edge Animate: the large box has mouseover trigger, on mouseover the button appears - after click, the page opens. On box mouseout, the button disappears.
    Have a look: https://dl.dropboxusercontent.com/u/145862/adobe_forum/Untitled-3.html
    The problem is that when the mouse leaves grey area, mouseout event fires. If I put the layer with button below the large transparent box, button stays visible, but click event doesn't work.
    Source files: https://dl.dropboxusercontent.com/u/145862/adobe_forum/overlapping_buttons.zip
    Mac OS 10.7.5 Edge Animate CC 3.0 Thank you in advance! cg.

    Hello,
    It seems you want this: overlapping revised.zip - Box
    Built with Edge 1.5
    Tested on Yosemite and Safari 8.0.2

  • Tabbed Panels - Default Tab on Mouseout

    Morning!
    I have looked all over the place for the answer to this question but alas...no luck!
    So I'm working on just adding one small bit of functionality for the basic spry tabbed panels; the ability that when the user moves their mouse off of the tabbed panels it resets the focused tab to whatever the declared defaultTab is on the page.
    So how do I set a mouseout event to reset the panel back to the defaultTab?
    Thanks!

    <!DOCTYPE HTML>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>Untitled Document</title>
    <link href="SpryAssets/SpryTabbedPanels.css" rel="stylesheet" type="text/css">
    <script src="SpryAssets/SpryTabbedPanels.js" type="text/javascript"></script>
    <script src="SpryAssets/SpryDOMUtils.js" type="text/javascript"></script>
    <script>
    function myMouseOutHandler(event) {
        TabbedPanels1.showPanel(0);
    </script>
    </head>
    <body>
    <div id="TabbedPanels1" class="TabbedPanels">
      <ul class="TabbedPanelsTabGroup">
        <li class="TabbedPanelsTab" tabindex="0">Tab 1</li>
        <li class="TabbedPanelsTab" tabindex="0">Tab 2</li>
      </ul>
      <div class="TabbedPanelsContentGroup">
        <div class="TabbedPanelsContent">Content 1</div>
        <div class="TabbedPanelsContent">Content 2</div>
      </div>
    </div>
    <script type="text/javascript">
    var TabbedPanels1 = new Spry.Widget.TabbedPanels("TabbedPanels1");
    Spry.Utils.addEventListener("TabbedPanels1", "mouseout", myMouseOutHandler, false);
    </script>
    </body>
    </html>

  • Copy XML data out of event.result to a XML var doesn't work

    So I'm pretty new to Flex, but learning with the help of a few books. I'm totally stumped here though, as I"m copying an example right out of The Flex 3 Bible and its not working the way I thin it should. My code is below. Here is my problem. I'm reading in an XML from a php script. Works fine. In Debug I can tell the event.result is getting the XML as it should. In the resultHandler I'm trying to copy it to a variable I assigned called myCollection. This is just not occuring for some reason. If I look at the variable in debug, its null. following that i"m trying to take innertags and get them out (myCollection.trumpet.settings). Of course this doesn't work because myCollection is populated with nothing. This came right out of an example on page 654... I've been bangging my head against the wall for hours. any help on how to copy this data out of event.result would be great.
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
    <mx:Script>
      <![CDATA[
       import mx.rpc.events.ResultEvent;
       import mx.collections.ArrayCollection;
       [Bindable]
       private var myCollection:XML;
       private var xReturn:Object;
       private function resultHandler(event:ResultEvent):void
        myCollection = event.result as XML;
           xReturn = myCollection.trumpet.setting;
       // textbox.text = myCollection;
      ]]>
    </mx:Script>
        <mx:HTTPService id="myService" url="http://10.101.50.60/get_config.php"
            method="POST" showBusyCursor="true" result="resultHandler(event)"/>
        <mx:VBox left="25" top="25">
            <mx:Button label="Get Data" click="myService.send()"/>
      <mx:Label id="textbox">
      </mx:Label>      
    <!--       <mx:DataGrid id="myGrid" dataProvider="{myCollection}"/>-->
        </mx:VBox>
    </mx:Application>

    Try setting resultFormat="e4x" in the HTTPService.

  • Stoping a group of child components from listening for mouseover event.

    Hi,
    I am trying to create a type of navigation system in this little app i'm working on which executes a function when the mouse is rolled over a canvas container. There are four of these canvas container which carry child components like labels, image, and text controls. These canvas containers have an initial alpha values of 0.5 so i want the fade effect to gradually animate to 1.0 when the mouse is rolls over it. When the mouse rolls out i want the alpha to animate the alpha values back to 0.5. I have sucessfuly done this here is a sample code.
         public function rollOverEffect(e:Event):void
              var ROFadeEffect:Fade=new Fade(e.target);
              ROFadeEffect.duration=500;
              ROFadeEffect.alphaFrom=0.5;
              ROFadeEffect.alphaTo=1;
              ROFadeEffect.end();
              ROFadeEffect.play([e.target]);
         public function rollOutEffect(e:Event):void
              var ROFadeEffect:Fade=new Fade(e.target);
             ROFadeEffect.duration=500;
              ROFadeEffect.alphaFrom=1;
              ROFadeEffect.alphaTo=0.5;
              ROFadeEffect.end();
              ROFadeEffect.play([e.target]);
    So this is working but not perfect...everytime my mouse rolls over the canvas it comes to life (Fades in).....but when it rolls over its child components, it fades out. I really dont follow why. Do i need to stop these child components from recieving events or what
    here is the MXML code for the UI
         <mx:Canvas  alpha="0.5" id="newMemCanvas" mouseOver="rollOverEffect(event)" mouseOut="rollOutEffect(event)"  x="448" y="32" width="252"      height="218" backgroundColor="#FBFBFB" borderColor="#15B5F7" borderStyle="solid" borderThickness="1" cornerRadius="4">
              <mx:Label x="61" y="24" text="New Members" fontWeight="bold" fontSize="14" color="#0EB6DA"/>
              <mx:Label x="10" y="65" text="0 New Member(s)" fontWeight="normal" fontSize="12" color="#434343"/>
              <mx:Image x="17" y="10" source="resource/studentUser.png" width="36" height="42"/>
              <mx:HRule x="14" y="55" width="226"/>
         </mx:Canvas>
         <mx:Canvas  alpha="0.5" id="recPosted" mouseOver="rollOverEffect(event)" mouseOut="rollOutEffect(event)" x="448" y="252" width="252"               height="218" backgroundColor="#FBFBFB" borderColor="#15B5F7" borderStyle="solid" borderThickness="1" cornerRadius="4">
              <mx:Label x="42" y="16" text="Recently Posted" fontWeight="bold" fontSize="14" color="#0EB6DA"/>
              <mx:Label x="14" y="65" text="No Post Yet!" fontWeight="normal" fontSize="12" color="#434343"/>
              <mx:Image x="10" y="10" source="resource/blog_post_new.png"/>
              <mx:HRule x="10" y="51" width="226"/>
         </mx:Canvas>
         <mx:Canvas  alpha="0.5" mouseOver="rollOverEffect(event)" mouseOut="rollOutEffect(event)" x="702" y="32" width="252" height="218"      backgroundColor="#FBFBFB" borderColor="#15B5F7" borderStyle="solid" borderThickness="1" cornerRadius="4">
              <mx:Label x="78" y="23" text="Unread Messages" fontWeight="bold" fontSize="14" color="#0EB6DA"/>
              <mx:Label x="17" y="64" text="0 Unread Message(s)" fontWeight="normal" fontSize="12" color="#434343"/>
              <mx:HRule x="14" y="54" width="226"/>
              <mx:Image x="10" y="20" source="resource/unreadMess.png" width="60" height="30"/>
         </mx:Canvas>
         <mx:Canvas  alpha="0.5" mouseOver="rollOverEffect(event)" mouseOut="rollOutEffect(event)" x="703" y="253" width="248" height="218"      backgroundColor="#FBFBFB" borderColor="#15B5F7" borderStyle="solid" borderThickness="1" cornerRadius="4">
              <mx:Image x="10" y="10" source="resource/mainLogo.png" width="41" height="35"/>
              <mx:Label x="55" y="18" text="Guided Tours" fontWeight="bold" fontSize="14" color="#0EB6DA"/>
              <mx:HRule x="11" y="51" width="226"/>
              <mx:Label x="10" y="66" text="Tower Building Video" fontWeight="normal" fontSize="11" color="#434343" textDecoration="underline"/>
              <mx:Label x="10" y="89" text="Student Interviews" fontWeight="normal" fontSize="11" color="#434343" textDecoration="underline"/>
              <mx:Label x="10" y="111" text="Social Events" fontWeight="normal" fontSize="11" color="#434343" textDecoration="underline"/>
              <mx:Label x="10" y="132" text="Living the School Life" fontWeight="normal" fontSize="11" color="#434343" textDecoration="underline"/>
         </mx:Canvas>
    ...any help will be greatly appreciated...thanx                                                                                    

    Hi l33tian,
    Check the below code with small modifications that I have made to your code in order to make it work...
    Observe the changes that I have made in your rollOver and rollOut functions and also in the mxml code in which I have taken a seperate canvas for all the canvases and added the mouseOver and mouseOut events on this canvas instead of outer canvas so that we can eliminte the problem of FadeOut when we mouseOver on the child components of canvas...
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" >
    <mx:Script>
      <![CDATA[
       import mx.effects.Fade;
       import mx.controls.Alert;
       public function rollOverEffect(e:Event):void
                var ROFadeEffect:Fade=new Fade(e.currentTarget.parent);
                ROFadeEffect.duration=500;
                ROFadeEffect.alphaFrom=0.5;
                ROFadeEffect.alphaTo=1;
                ROFadeEffect.end();
                ROFadeEffect.play([e.currentTarget.parent]);
           public function rollOutEffect(e:Event):void
               var ROFadeEffect:Fade=new Fade(e.currentTarget.parent);
               ROFadeEffect.duration=500;
               ROFadeEffect.alphaFrom=1;
                ROFadeEffect.alphaTo=0.5;
                ROFadeEffect.end();
                ROFadeEffect.play([e.currentTarget.parent]);
      ]]>
    </mx:Script>
    <mx:Canvas  alpha="0.5" id="newMemCanvas" x="448" y="32" width="252" height="218" backgroundColor="#FBFBFB" borderColor="#15B5F7" borderStyle="solid" borderThickness="1" cornerRadius="4">
              <mx:Label x="61" y="24" text="New Members" fontWeight="bold" fontSize="14" color="#0EB6DA"/>
              <mx:Label x="10" y="65" text="0 New Member(s)" fontWeight="normal" fontSize="12" color="#434343"/>
              <mx:Image x="17" y="10" source="resource/studentUser.png" width="36" height="42" maintainAspectRatio="false"/>
              <mx:HRule x="14" y="55" width="226"/>
         <mx:Canvas  width="100%" height="100%" mouseOver="rollOverEffect(event)" mouseOut="rollOutEffect(event)" />
         </mx:Canvas>
         <mx:Canvas  alpha="0.5" id="recPosted" x="448" y="252" width="252" height="218" backgroundColor="#FBFBFB" borderColor="#15B5F7" borderStyle="solid" borderThickness="1" cornerRadius="4">
              <mx:Label x="42" y="16" text="Recently Posted" fontWeight="bold" fontSize="14" color="#0EB6DA"/>
              <mx:Label x="14" y="65" text="No Post Yet!" fontWeight="normal" fontSize="12" color="#434343"/>
              <mx:Image x="10" y="10" source="resource/blog_post_new.png"/>
              <mx:HRule x="10" y="51" width="226"/>
        <mx:Canvas  width="100%" height="100%" mouseOver="rollOverEffect(event)" mouseOut="rollOutEffect(event)" />
         </mx:Canvas>
         <mx:Canvas  alpha="0.5" x="702" y="32" width="252" height="218"      backgroundColor="#FBFBFB" borderColor="#15B5F7" borderStyle="solid" borderThickness="1" cornerRadius="4">
              <mx:Label x="78" y="23" text="Unread Messages" fontWeight="bold" fontSize="14" color="#0EB6DA"/>
              <mx:Label x="17" y="64" text="0 Unread Message(s)" fontWeight="normal" fontSize="12" color="#434343"/>
              <mx:HRule x="14" y="54" width="226"/>
              <mx:Image x="10" y="20" source="resource/unreadMess.png" width="60" height="30"/>
        <mx:Canvas  width="100%" height="100%" mouseOver="rollOverEffect(event)" mouseOut="rollOutEffect(event)" />
         </mx:Canvas>
         <mx:Canvas  alpha="0.5" x="703" y="253" width="248" height="218"      backgroundColor="#FBFBFB" borderColor="#15B5F7" borderStyle="solid" borderThickness="1" cornerRadius="4">
              <mx:Image x="10" y="10" source="resource/mainLogo.png" width="41" height="35"/>
              <mx:Label x="55" y="18" text="Guided Tours" fontWeight="bold" fontSize="14" color="#0EB6DA"/>
              <mx:HRule x="11" y="51" width="226"/>
              <mx:Label x="10" y="66" text="Tower Building Video" fontWeight="normal" fontSize="11" color="#434343" textDecoration="underline"/>
              <mx:Label x="10" y="89" text="Student Interviews" fontWeight="normal" fontSize="11" color="#434343" textDecoration="underline"/>
              <mx:Label x="10" y="111" text="Social Events" fontWeight="normal" fontSize="11" color="#434343" textDecoration="underline"/>
              <mx:Label x="10" y="132" text="Living the School Life" fontWeight="normal" fontSize="11" color="#434343" textDecoration="underline"/>
              <mx:Canvas  width="100%" height="100%" mouseOver="rollOverEffect(event)" mouseOut="rollOutEffect(event)" />
         </mx:Canvas>
    </mx:Application>
    Check this out and please let me know..
    Thanks,
    Bhasker

  • ComboBox Close Event Bug?

    Resizing a browser makes dropdown to close but combobox
    doesn't trigger the close event. Is there a way to trigger the
    close event upon browser resize?
    thanks

    You could close it yourself upon a mouseOut event.

  • Why MovieClip's MouseOver and MouseOut both called on MouseOver

    hi,
    I have a simple movie clip for which i bind two events
    1- MouseOver
    2- MouseOut
    in these events i am just tracing simple text
    But the Problem is when i take my mouse over the movie clip both events called tracing the string in the output panel
    Infact, things should be done like that on mouse over, its text is printed and when i take my mouse away[out] from the movieClip MouseOut event should be called.
    import fl.motion.Color;
    import flash.display.MovieClip;
    import flash.events.MouseEvent;        
    var mc:MovieClip = new MovieClip();    
    mc.graphics.lineStyle(2, 0xCCCCCC)    
    mc.graphics.drawRect(20, 50, 160, 160);    
    mc.graphics.endFill();    
    this.addChild(mc);               
    mc.addEventListener(MouseEvent.MOUSE_OVER, onMouseOverMC);        
    mc.addEventListener(MouseEvent.MOUSE_OUT,  onMouseOutMC);                
    function onMouseOverMC(e:MouseEvent)
    {trace("MouseOverMC Called");}        
    function onMouseOutMC(e:MouseEvent)
    {trace("MouseOutMC Called");}

    Thanx for the response
    I tried that, but same thing is happening, you can copy/paste the code and chk it out
    Actually its considering the line as a movie clip
    and i noticed that when i take mouse on the line of movieClip it calls MouseOver/RollOver and when i entered into the square leave the line, it called MouseOut/RollOut event.
    so the flash is not considering the inner part of the square as a movie clip, its taking movieClip as a container.
    mc.graphics.lineStyle(2, 0xCCCCCC)   
    mc.graphics.drawRect(20, 50, 160, 160);   
    How can i make the whole rectangle as a single movie clip so that events work properly

Maybe you are looking for