1 Reply Latest reply on Apr 21, 2010 5:39 AM by David_F57

    change current state in actionscript

    dakasadakasadaka

      hello,

      In mxml I'm changing the state like this:

      <s:Button label="edit" click="{currentState='editObjectState'}"/>

      But now I have external AS file witch have the alert like this:

              public function onResult(responds:Object):void
              {
                  Alert.show("Object submitted", "...", Alert.OK);
              }

      And I want after clicked on OK button to change state to indexObjectState

      How could I do it?

      tnx.

      Daka

        • 1. Re: change current state in actionscript
          David_F57 Level 5

          hi,

           

          this will allow you to do what you want

           

           

          protected function button1_clickHandler(event:MouseEvent):void

          {

          Alert.show("I want It", "Indexing", 3, this, alertClickHandler);

          }

           

          private function alertClickHandler(event:CloseEvent):void

          {

          if (event.detail==Alert.YES)

          currentState = "state2";

          else

          currentState= "State1";

          }

          David

          1 person found this helpful