有谁知道我如何在flex 3中重置/重新初始化状态?
假设我有以下代码:
<mx:states>
<mx:State name="Scene1">
<mx:AddChild>
<Scenes:Scene1 id="scene1"></Scenes:Scene1>
</mx:AddChild>
</mx:State>
<mx:State name="Scene2">
<mx:AddChild>
<Scenes:Scene2 id="scene2" models="{models}"></Scenes:Scene2>
</mx:AddChild>
</mx:State>
</mx:states>
每次我从1到2或2到1时,我都不想重建整个州。
答案 0 :(得分:0)
我不确定这是您要找的内容,但此代码将呈现您在上面定义的状态:
// this shows Scene1
this.currentState = "Scene1";
// this shows Scene2
this.currentState = "Scene2";
那是你在找什么?