2 Replies Latest reply on Jun 15, 2009 7:44 AM by James Whittaker

    Spark button set state?

    James Whittaker

      I have a Spark Button and have tried to set it as selected like in Halo. It does not have a selected property so I tried to set the state using the following MXML:

       

      <s:Button label="Hello World" currentState="over" />

       

      This blows up when run with the error :

       

      ArgumentError: Undefined state 'over'.

       

      But a Button does have an over state! Is my thinking incorrect?

       

      Thanks again James

        • 1. Re: Spark button set state?
          CoreyRLucier Adobe Employee

          The Spark button in this case is not itself toggleable.  You will need to use a ToggleButton.  Spark controls are not the swiss army knives that Flex 3 components were (in order to keep things a bit lighter).

           

          The new Spark skinnable components control their own state internally and the components themselves in turn set the currentState of their associated skin at runtime.  The current state of the component is not (in general) directly controllable via 'currentState'.

           

          Regards,

           

          Corey

          • 2. Re: Spark button set state?
            James Whittaker Level 1

            Thanks Cory,

             

            I was just looking at the other components and must have missed ToggleButton, I'm getting there!

             

            Thanks James