1 person found this helpful
private function IsUserLoggedIn(evt:ResultEvent):void
if (evt.result.islogin.toString() == "true")
currentState = "MainMenu";
Alert.show("Login failed, please try again.", "Login Failed");
If I am right the above function is in your userlogin component and the two components "userlogincomponent" and "maincomponent" are in main application file and the states were also defined in main application file.
But in the function above the currentState refers to the state of the userlogin component and not the main application ...but the states are defined in main application file...that's the reason why the exception was thrown...
Instead you replace the line in the above function with the below line:
Application.application.currentState = "MainMenu";
Please mark it as answer if it helped you.
Thanks for the quick response. However since I was using the newer version, the exact code you mentioned did not worked as that class library has been discontinued. But your answer led to me the correct one, which is the FlexGlobals.topLevelApplication.currentState.
Again thanks alot.
Thanx..I am glad it helped you...
All the best for rest of your project.