[英]Why state transitions does not work in a flex mobile application?
I want to add transitions when state is changed in a flex mobile app like this: 我想在flex移动应用程序中更改状态时添加转换,如下所示:
<s:states>
<s:State name="State1"/>
<s:State name="resultsState"/>
</s:states>
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
<s:Transition fromState="''" toState="resultsState">
<s:Sequence duration="2000">
<s:Fade target="{myTitle}"/>
<s:Move targets="{[cityNameInput,searchBtn]}"/>
<s:AddAction target="{''}"/>
/>
</s:Sequence>
</s:Transition>
</fx:Declarations>
<s:Button id="about_state" includeIn="resultsState" label="About"
click="result_state()" icon="@Embed('assets/About.png')"
/>
// Function Code is : //功能代码是:
private function result_state():void{
currentState = 'resultsState';
}
Please Help. 请帮忙。
You have to declare your transition inside the component's <s:transitions/>
array attribute instead of declaring it inside a <fx:Declarations/>
block: 您必须在组件的<s:transitions/>
数组属性中声明<s:transitions/>
而不是在<fx:Declarations/>
块中声明它:
<s:states>
<s:State name="State1"/>
<s:State name="resultsState"/>
</s:states>
<s:transitions>
<s:Transition fromState="*" toState="resultsState">
<s:Sequence duration="2000">
<s:Fade target="{myTitle}"/>
<s:Move targets="{[cityNameInput,searchBtn]}"/>
</s:Sequence>
</s:Transition>
</s:transitions>
<s:Button id="about_state" includeIn="resultsState" label="About"
click="result_state()" icon="@Embed('assets/About.png')"/>
You have plenty of examples at Adobe Documentation site . 您在Adobe文档站点上有大量示例。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.