In mxml you declare states like this:
<box:states>
<s:State name="active"/>
<s:State name="disabled"/>
</box:states>
How do you acheive the same in an ActionScript class? Apparently it's the same in Flex 3 and Flex 4, whatever it is.
In mxml you declare states like this:
<box:states>
<s:State name="active"/>
<s:State name="disabled"/>
</box:states>
How do you acheive the same in an ActionScript class? Apparently it's the same in Flex 3 and Flex 4, whatever it is.
If you can avoid it, do!
That said, hold your breath!
That said, take a look at the State Class. Create a new instance and define the overrides. I believe all the overrides are link in the "see also" link.
Each component has a "states" array.
So, just create the states manually. Add the relevant overrides, and add that state to the states array.
It isn't hard, but it can be pretty tedious. I did this for the Flextras Calendar.
Thanks for the answers. Here's what I came up with:
// constructor
public function MyBox() {
states = new Array();
for each (var name:String in ['working', 'active', 'disabled']) {
var state:State = new State();
state.name = name;
states.push(state);
}
}