2 Replies Latest reply on Nov 10, 2009 9:48 AM by jabavox

    (Help) PopUpManager with States ......!!!!!!


      I have two MXML files (Main.mxml & PopWindow.mxml).

      The first one is Main.mxml,

      and I've already specified 3 states in it, including FirstPage, SecondPage, and ThirdPage.


      For the script part of this Main.mxml, I also did something like this:




                  import mx.managers.PopUpManager;
                  private function doCreate():void {
                      var win:PopWindow = PopUpManager.createPopUp(this, PopWindow,  true) as PopWindow;
      and I add click="doCreate()" into the 'create' button that I specied in the 'FirstPage' state
      The second one is PopWindow.mxml,
      and I use TitleWindow with the two buttons, including 
      a ' ok ' button and a ' cancel ' button.


      For 'ok' button, I set currentState="SecondPage"

      For 'cancel' button, I set currentState="FirstPage"


      For the script part of this PopWindow.mxml, I also did something like this:





                 import mx.events.CloseEvent;

                 import mx.managers.PopUpManager;



                 private function titleWindow_close(evt:CloseEvent):void {







      and also add close="titleWindow_close(event);" in the <mx:TitleWindow>

      for the window close button.


      After that I ran the files, I clicked on the ' create ' button at the FirstPage,

      and the popup title window appeared.


      But the problem occurred after I click on the 'ok' button or the 'cancel' button.

      I got the error message stated that " Undefined state 'SecondPage' " or  " Undefined state 'FirstPage' " .


      ..Any help or suggestion for this ??


      In case if I can't use PopUpManager ,

      Is there the way like to let one state or component pop up inside another state,

      and still move back and forth between states ??

      Sorry....I'm quite new to flex, and this took me like 2 days already to work around with this.

      Thank you for spending your time reading / replying this topic...