I am having an issue with flex states in my application. What I am looking to do is on creation complete of the application, obtain a user role guest/user/superUser (based on username and password) from a server, then set the state client side based on that information. My .mxml classes need to include certain graphic elements based on that state. I am running into the issues of including elements based on the states defined at the Application level of the project. I am trying to avoid having to define the states in each .mxml file that needs it.
I feel that this is possibly something easy that I am overlooking or maybe there is a better way to do this. Any examples input is very helpful.
I know that this returns the current state
Application.application.currentState;
but I am looking to almost "populate" the
<mx:states>
<mx:State name="state1"/>
</mx:states>
of every .mxml file from the states defined in the Application