My index.mxml has two states a login state and viewer state. As of now my viewer opens in the login state, but my goal is the opposite. I want to keep the login functionality I have, and implement it a little differently. I need the viewer to load in the viewer state but then have a login button that switches to the login state when clicked. My plan was to have a function that made currentState = "Login" in the index.mxml and then have a button or label within the HeaderControllerWidget.mxml that could be clicked wich would then call the funcion. My problem is the header controller part. I am not quite sure how to import a function that is in the index.mxml. If anyone could help with that, or tell me that my logic is off and there is a better way of doing it, I would really appreciate it.
I ended up solving my own problem. I just created a copy of the index.mxml and called it secure.mxml and each load on a different state. Logging In and Logging out will determine which one you get. I figured I would post this in case anybody cares.
I ended up solving my own problem. I just created a copy of the index.mxml and called it secure.mxml and each load on a different state. Logging In and Logging out will determine which one you get. I figured I would post this in case anybody cares.
M Lowry, Sure, I am using a concept I got from Robert Scheitlin at the 2012 Developer Summit where he demoed an application that used a login screen. I used a lot of the code he gave out to base my code on. The basic concept is the index.mxml has two states a "login" and "viewer" state. The source code he gave out loads into the login state and then after receiving credentials from an authentication service it loads the viewer state. I am using a different approach but the same concept, as I mentioned earlier in the above post my viewer loads the viewer state by default and essentially switches to a different application when the sign in button is clicked. I created a second index.template.html as well as another mxml in the src folder.