2 Replies Latest reply on Apr 8, 2009 1:44 PM by firdosh

    EventDispatching Continously on Rollover RollOut Events

    firdosh

      I have a simple mxml component tht extends Canvas. When I try and show the border / focus skin on a rollover / rollout event for my backgroung image

      the rollover and rollout event get fired continously. What is triggering the roll out event ?. I have attached the src example (flex prj archive).

       

      Thank You

      Firdosh.

       

      item.jpg

       

       

      <mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" width="124" height="148">
      
          <mx:Script>
      
              <![CDATA[
      
                  private function onRollOver():void
      
                  {
      
                      trace("rollover");
      
                      focus.visible = true;
      
                  }
      
                  
      
                  private function onRollOut():void
      
                  {
      
                      trace("rollout");
      
                      focus.visible = false;
      
                  }
      
              ]]>
      
          </mx:Script>
      
          <mx:Image x="0" y="0" width="124" height="148"
      source="@Embed('background.png')" rollOver="onRollOver();"
      rollOut="onRollOut();"/>
      
          <mx:Image x="10" y="10" width="104" height="79" source="@Embed('img.jpg')"/>
      
          <mx:TextInput x="10" y="97" width="104"/>
      
          <mx:Label x="10" y="127" text="Test" color="#FFFFFF"/>
      
          <mx:Label x="85" y="127" text="Test" color="#FFFFFF"/>
      
          <mx:Image x="0" y="0" width="124" height="148" source="@Embed('selected.png')" id="focus" visible="false"/>
      
      </mx:Canvas>
      

       

       

      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" xmlns:local="*">
           <local:Tile />
      </mx:Application>