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

Custom <s:ToggleButton> Skin

Explorer ,
May 09, 2010 May 09, 2010

Copy link to clipboard

Copied

I started with a copy of the default skin class.

The lines:

    <!-- text -->     <s:Label id="labelDisplay"              textAlign="center"              verticalAlign="middle"                 maxDisplayedLines="1"              horizontalCenter="0" verticalCenter="1"              left="10" right="10" top="2" bottom="2">     </s:Label>

display a different text for each instance of <s:ToggleButton label="x"><s:ToggleButton label="y"> . . .

How do I have to code the custom skin to be able to assign an "unselectedIcon" and "selectedIcon" to each instance of a <s:ToggleButton> ?

As in:

<s:ToggleButton width="50" height="50"           horizontalCenter="0" verticalCenter="0"           unselectedIcon="EmbeddedResources.firstToggleIconUnselected"           selectedIcon="EmbeddedResources.firstToggleIconSelected"           skinClass="Skins.CustomToggleButtonSkin" />

<s:ToggleButton width="50" height="50"           horizontalCenter="60" verticalCenter="0"           unselectedIcon="EmbeddedResources.secondToggleIconUnselected"           selectedIcon="EmbeddedResources.secondToggleIconSelected"           skinClass="Skins.CustomToggleButtonSkin" />

Thanks for any help,

David

Views

1.1K

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

correct answers 1 Correct answer

Deleted User
May 31, 2010 May 31, 2010

Hi,

You would need to extend the toggleButton, and add these as Styles to the extended component. These can then be used in the skinClass using getStyle. They have explained how to create a custom icon for a button here

http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf69084-7d9f.html (towards the end of the page).

So use the styles you created as sources for the Bitmap images in the skinClass. Hope this helps.

Nishad

Votes

Translate

Translate
Guest
May 31, 2010 May 31, 2010

Copy link to clipboard

Copied

Hi,

You would need to extend the toggleButton, and add these as Styles to the extended component. These can then be used in the skinClass using getStyle. They have explained how to create a custom icon for a button here

http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf69084-7d9f.html (towards the end of the page).

So use the styles you created as sources for the Bitmap images in the skinClass. Hope this helps.

Nishad

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
Explorer ,
May 31, 2010 May 31, 2010

Copy link to clipboard

Copied

LATEST

Thanks Nishad,

I will use vector graphics for the various icons and get them into the given button instance with getStyle.

David

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