문제

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