Flex 4 / Flash 4 Add to Current State
        Posted  
        
            by user163757
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by user163757
        
        
        
        Published on 2010-05-28T15:18:02Z
        Indexed on 
            2010/05/28
            15:21 UTC
        
        
        Read the original article
        Hit count: 347
        
I am having a little difficulty working with states in Flex (or Flash) 4. Lets say that my application has three states; the default (base) state, state 1, and state 2.
State 1 should always be based on the base state, that's easy enough to accomplish. However, I would like state 2 to be based on the current state (either base or state 1). I can't for the life of me figure it out. I tried setting the basedOn property of state 1 to "this.currentState", but that just crashes my browser.
 <s:states>
  <s:State name="default"/>
  <s:State name="state1"/>
  <s:State name="state2" basedOn="{this.currentState}"/>
 </s:states>
 <s:TitleWindow id="configWindow" includeIn="state1" width="250" height="100%" close="configWindow_closeHandler(event)"/>
 <s:Panel id="settings" includeIn="state2" width="200" height="200"/>
        © Stack Overflow or respective owner