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" />
I'll recommend you to use a ViewStack instead of States, States in Fx 3 are kinda diffucult to declare and manage as your app grows. Fortunately in the Flex SDK 4 there will be a much simpler syntax to declare states.
Michael, thanks for your response.
ViewStack is not an ideal alternative in my situation, I need to use States.
Probably if you wanna go the pure AS 3.0 way what you'll need to do is add or remove controls dinamically at runtime.