5 Replies Latest reply on Oct 26, 2007 1:37 PM by Chief Ingredient

    <mx:states> & button click problem.

    mark416 Level 1
      Hi,

      I use <mx:states> build two screen,(base state and screen).

      I have button on <base state>,for the click event I add the code like

      <mx:Button x="105" y="323" label="Button" click="currentState='screen1'" id="button1"/>

      But when I put the button in a mxml component and then I add the component on base state.

      I get error when I use the same code and click the button.


      MAIN PAGE
      ----------------

      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" layout="absolute" xmlns:CTComp="*">
      <CTComp:page1 id="page11"/>
      </mx:Application>

      page1.mxml
      --------------------

      <?xml version="1.0" encoding="utf-8"?>
      <mx:Canvas xmlns:mx=" http://www.adobe.com/2006/mxml" width="400" height="300">
      <mx:Label x="51" y="89" text="Requestor"/>
      <mx:TextInput x="133" y="87"/>
      <mx:Button x="133" y="136" label="Login" width="103" click="currentState='screen2'"/>
      <mx:Label x="112" y="33" text="Catering Request Form" width="158" fontWeight="bold" fontSize="12"/>

      </mx:Canvas>

      How to fix the button event on mxml component?Thanks for help

      M