0 Replies Latest reply on Mar 29, 2007 12:35 PM by Gareth_Adams

    Resizing onmouseover - hit area problems

    Gareth_Adams
      Hi, I'm new to Flex and loving it so far, but I've hit my first problem

      The component below should show more information (change to a state with an extra field) and resize itself onmouseover. This works fine.

      This effect should be reversed onmouseout, and this almost works.

      While in mouseover, moving the mouse onto the border of the box or the new Text control, the resize seems to get cancelled and everything jumps around a lot. I have no idea why and I'm hoping you nice Flex guys can help

      <?xml version="1.0" encoding="utf-8"?>
      <mx:VBox xmlns:mx=" http://www.adobe.com/2006/mxml" x="0" y="0" width="100%" verticalGap="0" mouseOver="currentState='details'" mouseOut="currentState=''" cornerRadius="4" borderColor="#000080" borderStyle="solid" borderThickness="2">
      <mx:states>
      <mx:State name="details">
      <mx:AddChild position="lastChild">
      <mx:Text id='itemInfo' text="added by John" width="100%" textIndent="20"/>
      </mx:AddChild>
      </mx:State>
      <mx:State name="summary"/>
      </mx:states>

      <mx:transitions>
      <mx:Transition id="toDetails" fromState="*" toState="details">
      <mx:Sequence>
      <mx:Resize target="{this}"/>
      </mx:Sequence>
      </mx:Transition>
      <mx:Transition id="fromDetails" fromState="details" toState="*">
      <mx:Sequence>
      <mx:Resize target="{this}"/>
      </mx:Sequence>
      </mx:Transition>
      </mx:transitions>

      <mx:HBox width="100%" horizontalAlign="right" verticalCenter="0">
      <mx:Text text="Song Title - Artist Name (Album Name)" width="100%" enabled="true" id="track"/>
      <mx:Text text="0:00:00" id="duration"/>
      </mx:HBox>
      </mx:VBox>