4 Replies Latest reply on May 7, 2008 8:03 AM by sulletf

    mouseMove, mouseOver events on Label

    sulletf
      Hi!

      using a "paddingRight" style greater than 0 (actually 100 to see the problem better), i expected than the "mouseOver", "mouseMove" application area would be extended to the padded area, but it seems not.

      In the following example, we clearly see that the "mouseOver" event is triggered when the mouse is out of the Label text, not the Label itself !

      Is this normal behaviour ?

      Thanks.

      FRED

      <?xml version="1.0" encoding="utf-8"?>

      <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" layout="absolute">

      <mx:Script>
      <![CDATA[

      import mx.events.*;
      import mx.core.*;

      private function fred(event:Event):void {
      if (event.type == 'mouseOver') { mybox.visible=true }
      if (event.type == 'mouseOut') { mybox.visible=false }
      }

      ]]>
      </mx:Script>

      <mx:Label id="mylabel" text="a label" x="50" y="50" paddingRight="100" mouseOver="fred(event)" mouseOut="fred(event)"/>
      <mx:Box id="mybox" borderStyle="solid" borderThickness="2" width="{mylabel.width+4}" height="{mylabel.height+4}" x="{mylabel.x-2}" y="{mylabel.y-2}" visible="false" />

      </mx:Application> Text Text