Reading application states in child component Flash Builder 4


i have states in application this:

 

 

<app:states>      <s:state name="introstate"/>      <s:state name="mainmenustate"/>      <s:state name="playerstate"/> </app:states> 

 

 

i have child component instantiate this:

 

 

<compnts:header id="header"/> 

 

 

 

inside that, have buttons want include , in states. trying this:

 

 

 <s:button label="intro" includein="{flexglobals.toplevelapplication.currentstate == 'introstate'}"/>   or   <s:button label="intro" includein="{flexglobals.toplevelapplication.state('introstate')}"/> 

 

...or that. 

 

how done? there way use includein , reference main application's states?

 

 

thanks lot this!!!

i'm not sure if possible since includein not allow specify value using binding.  duplicating application's states in custom component , binding currentstate of component currentstate of application?

 

main.mxml:

<s:application...>
    <s:states>
        <s:state name="state1" />
        <s:state name="state2" />
    </s:states>
   
    <components:header currentstate="{currentstate}" />

 

</s:application>

 

header.mxml:

<s:group...>
    <s:states>
        <s:state name="state1" />
        <s:state name="state2" />
    </s:states>
   
    <s:button label="state1" includein="state1" />

 

</s:group>



More discussions in Flex (Read Only)


adobe

Comments

Popular posts from this blog

Hur installera Joomla på One.com - Joomla! Forum - community, help and support

removing index.php from URL address - Joomla! Forum - community, help and support

「イメージマップのアンカー名には、...」のエラーが出ないようにしたい