2 Replies Latest reply on Sep 27, 2006 12:13 PM by yoyesman

    Changing state in a component

    Level 1
      Hi, I try to change the current state of a component inside it. But the code bellow doesn't change the state.

      Here the component start code :

      <mx:Canvas click="clickHandle(event);" xmlns:mx=" http://www.adobe.com/2006/mxml" width="570" height="360" xmlns:local="*">

      import flash.events.Event;
      import mx.controls.Image;
      import mx.controls.Alert;

      public function clickHandle(eventObj:Event):void {

      When I click, the openAlert() function is right call, but the currentState doesn't change. I try with this.currentState='liste' but no change. May be I miss something.

      The final goal of this, is to change the state of a component by clicking buttons inside the component. And with my method I'm not sure to be able to know wich button is pressed... May be there is a simple way to do this inside a component.

      Thanks for your help.