4 Replies Latest reply on Jan 9, 2010 8:25 PM by John Hall

    State change with custom event

    John Hall Level 4

      I have an oddball thing going on. I have a component for which can change the state without issue with a buttonclick within the component. However, when I create a custom event to change the state based on something else happening, it won't change.

       

      In it's simplest form, here are the two instances

       

      This is the script within the component that works fine:

                  public function displayState():void{
                      currentState = "display";
                      trace(this.currentState);
                  }

       

                traces: display

                shows: display state

       

      However, this script, which receives a custom event and parameter, displays the trace properly saying that it has changed states but it doesn't refresh the screen to reflect that:

       

                  public function changeState(value:String):void{
                      currentState = value;
                      trace(this.currentState);
                  }

       

                traces: display

                shows: remains on edit state

       

      To add to the mix, even if I hard wire the state change as a test that is triggered by the custom event, once again it traces properly saying that it has changed state but no difference on the screen.

       

                public function changeState(value:String):void{
                       currentState = "display";
                       trace(this.currentState);
                   }

       

                traces: display

                shows: remains on edit state

       

      Am I missing something obvious?

       

      I've tried the beta 2 plus 2 different nightly builds including the Jan 5 build.