Oh.. titleWindow is cool!  I will try to work with that.
 
There are sooo many parts to flex it is hard to know what is available to use.  
Even with the component explorer web page open I have a hard time.
 
Thanks Sherif!
 
 
 
From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Sherif 
Abdou
Sent: Wednesday, March 05, 2008 2:42 PM
To: [email protected]
Subject: Re: [flexcoders] how to have a component change the state
 
well i am guessing that the main is in App so i think it should be currentState 
= Application.application.main
or you can just use a titleWindow and just remove it which would be a bit 
easier.
----- Original Message ----
From: Chad Gray <[EMAIL PROTECTED]>
To: "[email protected]" <[email protected]>
Sent: Wednesday, March 5, 2008 1:10:05 PM
Subject: [flexcoders] how to have a component change the state
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.
 
 



Never miss a thing. Make Yahoo your homepage.  

<<attachment: image001.jpg>>

Reply via email to