Hi all,
  For simplification, let's say I have an app with two states as follows:

<mx:states>
  <mx:State name="LEFT">
    <mx:SetStyle target="{PREVIEW}" name="left" value="0"/>
    <mx:SetStyle target="{PREVIEW}" name="right"/>
  </mx:State>
  <mx:State name="RIGHT">
    <mx:SetStyle target="{PREVIEW}" name="left"/>
    <mx:SetStyle target="{PREVIEW}" name="right" value="0"/>
  </mx:State>
</mx:states>

<mx:Canvas id="PREVIEWHOLDER"
      includeInLayout="false"
      x="20"
      y="20"
      width="1000"
      height="1000">
      <mx:Canvas id="PREVIEW"
            <mx:Image id="previewImg">
            </mx:Image>
      </mx:Canvas>
</mx:Canvas>

The idea is that in state LEFT, PREVIEW anchors to the left of it's
parent container PREVIEWHOLDER, and state RIGHT anchors it to the
right edge of PREVIEWHOLDER.  PREVIEW is always smaller than its
parent, but its size changes as it is being populated with content.
(mostly determined by the size of the image loaded into previewImg)

What actually happens is that whichever state is used first works
fine, but when I switch to the other state, PREVIEW is anchored to
both sides of its parent, making it 1000px wide regardless of what's
inside it.  My real app actually has 4 states, but the idea is the same.

This code:
    <mx:SetStyle target="{PREVIEW}" name="right"/>
(without any value attribute) was generated by FlexBuilder when I
cleared the right anchor in design view, and it doesn't work.  It also
doesn't work by setting the value attribute to any of "", "{null}", or
"{undefined}".  Leaving the tag out altogether also doesn't work.

How do I create a state that says "DON'T anchor to the right anymore."

Thanks!

Rick Englert








--
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