0 Replies Latest reply on Jul 11, 2011 5:56 AM by Shailen TJ

    Access States in Modules

    Shailen TJ Level 1

      Hello, I am having trouble accessing states in a module.

      Knowing that my application would grow, I have started to modularise right away. For a simpel case, let us take the example from this website:

      http://evontech.com/forum-need-help/topic/875.html

       

      We have the Main.mxml and two mxml files (MainView and LoginView).

       

      Main.mxml:

      <?xml version="1.
      
      0" encoding="utf-8"?>
      <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:view="view.*">
        <mx:TabNavigator>
            <view:LoginView />
            <view:MainView />
        </mx:TabNavigator>
      </mx:Application>

       

      Now, assume that have a state named StateB in MainView, and a button in LoginView. When I click on the button in LoginView, I was StateB in Mainview to open. How do I do that?

       

      This is the snippet from LoginView:

      protected function addBtn_clickHandler(event:MouseEvent):void

      {

      currentState = "StateB";

      }

       

      Thank you very much.