2 Replies Latest reply on Sep 13, 2010 10:24 AM by brian914

    Reading application states in child component Flash Builder 4

    brian914 Level 1

      I have States in my application that look something like this:

       

       

      <app:states>
           <s:State name="IntroState"/>
           <s:State name="MainMenuState"/>
           <s:State name="PlayerState"/>
      </app:states>
      

       

       

      I then have a child component that I instantiate like this:

       

       

      <compnts:Header id="header"/>
      

       

       

       

      Inside that, I have buttons that I want to include and in only certain states. I was trying to do something like this:

       

       

      <s:Button label="Intro" includeIn="{FlexGlobals.topLevelApplication.currentState == 'IntroState'}"/>
      
      
      or 
      
      <s:Button label="Intro" includeIn="{FlexGlobals.topLevelApplication.state('IntroState')}"/>
      

       

      ...or something like that.
      

       

      How is that done? Is there a way to use includeIn and reference back to the main application's states?

       

       

      Thanks a lot for any help with this!!!