• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

skinned ToggleButton

New Here ,
Jan 23, 2011 Jan 23, 2011

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

Views

339

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jan 24, 2011 Jan 24, 2011

Copy link to clipboard

Copied

LATEST

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines