What I usually do is have a model object that is separate from the views
(MVC). In that class I would define a bindable property like [Bindable]
viewState:String;... then bind my main currentState to it as follows
currentState="{theModel.viewState}". Now any view (like login view) can
update model.viewState and the main.currentState will change via the
binding.
hth
Scott
Scott Melby
Founder, Fast Lane Software LLC
http://www.fastlanesw.com
Chad Gray wrote:
> Say I have a component file that is called Login. It asks for login and
> password and if they succeed I want the currentState of the main MXML file to
> change to one called "main".
>
> When I had all of the code on the one main mxml I used this code to change
> the state:
>
> private function letUserIn():void{
> if (roServalent.authUser.lastResult == true) {
> this.currentState = 'main';
> }
> }
>
> When I run this code in the component file I get an error "ArgumentError:
> Undefined state 'main'."
>
> I know the scope "this.currentState" is what is causing the error.
>
> How do I scope currentState so it can find the "main" state in the main MXML
> file?
>
> I guessed super.currentState but that did not seem to work.
>
>
>