質問

From a viewClass called TheFirstView I want to "move" to a viewClass called TheSecondView with the state SpecificState.

I know how to get to the TheSecondView, the code is: navigator.pushView(TheSecondView);

Is there a way to specify using pushView() that you want to "move" to SpecificState in TheSecondView?

役に立ちましたか?

解決

You can pass data into the view; which is the second property of the pushView method, like this:

navigator.pushView(TheSecondView, 'SpecificState')

Inside the view, you can listen for the viewActivated event to change the state:

Add the listener:

<s:View xmlns:fx="http://ns.adobe.com/mxml/2009" viewActivate="onViewActivated()">

And in some ActionScript code, implement the listener like this:

protected function onViewActivated():void{
 currentState=data;
}
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top