3 Replies Latest reply on May 25, 2009 4:30 PM by Michael Borbor

    Add states with ActionScript, because MXML states occupying space

    DigitalSpeciaist Level 1

      I have my States setup with MXML fine, but I noticed that even though the State is not currently set, it is occupying space and leaving a huge empty gap in my layout.

       

      I want the State to not occupy the space when it is not the active State.

       

      I think using ActionScript to dynamically add the State when it is needed will solve the problem. What is the ActionScript code to add States (to replace all the State MXML code below)?

       

      <mx:Labe text="No State should be visible and don't occupy any space" />

      <mx:states>

      <mx:State name="{displayThisState}">

      <mx:AddChild>

      </mx:AddChild>

      </mx:State>

      </mx:states>

       

      Thanks.