Copy link to clipboard
Copied
Hello, I have two toggle buttons and I have two mxml files that are their skins.
In each mxml skin there are 8 states ("up", "down",...)
When I change state, I would like my toggle buttons to return to the up state, but if I call
togglebutton1.currentState = "up";
togglebutton2.currentState = "up";
or
togglebutton1.currentState = 'up';
togglebutton2.currentState = 'up';
I receive an error and the application breaks
(ArgumentError: Undefined state 'up'.
at mx.core::UIComponent/getState()
at mx.core::UIComponent/findCommonBaseState()
at mx.core::UIComponent/commitCurrentState()
at mx.core::UIComponent/setCurrentState()
at mx.core::UIComponent/set currentState()
at Main/button_clickHandler()[...src\Main.mxml:111]
at Main/__button1_click()[...src\Main.mxml:1638])
I've also tried to call:
togglebutton1.currentState = "";
togglebutton2.currentState = "";
and
togglebutton1.currentState = null;
togglebutton2.currentState = null;
but it doesn't work, the buttons don't change their state.
Can anyone help?
Thanks a lot
Copy link to clipboard
Copied
This appears to be a Flex question. Please try the Flex forums here http://forums.adobe.com/community/flex/flex_general_discussion for better response.