Tag Archive for 'button'

20
Aug

Changing the default skins on a Button control in Flex

The following example shows how you can modify the default skins for the Flex Button control by setting the skin, upSkin, overSkin, downSkin, and disabledSkin styles.

Full code after the jump.

Continue reading ‘Changing the default skins on a Button control in Flex’

26
Jun

Detecting when the label placement changes on a Button control in Flex

In an earlier example, “Positioning an icon within a button using the Button.labelPlacement property”, we saw how you can set a Flex Button control’s label placement using the labelPlacement property.

The following example shows how you can detect when the labelPlacement property has changed using the labelPlacementChanged event.

Full code after the jump.

Continue reading ‘Detecting when the label placement changes on a Button control in Flex’

25
Jun

Detecting when the label changes on a Button control in Flex

The following example shows how you can detect when a Flex Button control’s label changes using the labelChanged event.

Full code after the jump.

Continue reading ‘Detecting when the label changes on a Button control in Flex’

17
Jun

Setting a creation complete effect on a Button control in Flex

The following example shows how you can set a creation complete effect on a Flex Button control by setting the creationCompleteEffect style.

Full code after the jump.

Continue reading ‘Setting a creation complete effect on a Button control in Flex’

21
May

Aligning a label in a Button control in Flex

The following example shows how you can align the text label within a Flex Button control by setting the textAlign style.

Full code after the jump.

Continue reading ‘Aligning a label in a Button control in Flex’

29
Feb

Setting a Button control’s icon to an asset from a SWF file in Flex

The following example shows how you can set a Flex Button control’s icon style to an asset from a SWF file using MXML or ActionScript.

Full code after the jump.

Continue reading ‘Setting a Button control’s icon to an asset from a SWF file in Flex’

02
Jan

Changing the padding on a Button control in Flex

The following example shows how you can modify the padding between the Button control’s label and icon and the button’s edges by setting the paddingLeft, paddingRight, paddingTop, paddingBottom, and horizontalGap styles.

Full code after the jump.

Continue reading ‘Changing the padding on a Button control in Flex’

02
Jan

Changing the fill colors of a Button control in Flex

The following example shows how you can change the background fill colors and fill alphas of a Button control in Flex by setting the fillColors, and fillAlphas styles.

Full code after the jump.

Continue reading ‘Changing the fill colors of a Button control in Flex’

11
Dec

Creating a double-click-able Button control in Flex

The following examples show how you can set a Flex Button control to listen for doubleClick events by setting the doubleClickEnabled property using both MXML and ActionScript.

Full code after the jump.

Continue reading ‘Creating a double-click-able Button control in Flex’

02
Nov

Changing a Button control’s icon when the button is disabled

I think I saw somebody ask this on the FlexCoders mailing list, but thought I’d post the solution here since I don’t think I’ve covered it before.

The following example shows how you can set the disabledIcon style on a Flex Button control to set a different icon for when the Button control’s enabled property is set to false.

Full code after the jump.

Continue reading ‘Changing a Button control’s icon when the button is disabled’

24
Sep

Creating a simple Flex Accordion inline header renderer

The following example shows how you can create a simple, inline header renderer in Flex which uses the Button control for a Flex Accordion header.

Full code after the jump.

Continue reading ‘Creating a simple Flex Accordion inline header renderer’

23
Sep

Setting a Flex component or control’s width to a percentage value

The following example shows how you can set a Button control to use percentage-based width and heights in ActionScript by using the [aptly named] percentWidth and percentHeight properties respectively.

Full code after the jump.

Continue reading ‘Setting a Flex component or control’s width to a percentage value’

13
Sep

Checking to see if a Flex CheckBox is selected before allowing a user to press a Button

The following example shows a few different ways of checking to see if the user selected a CheckBox control before allowing them to click a Button control. Got other tips? Leave them in the comments!

Full code after the jump.

Continue reading ‘Checking to see if a Flex CheckBox is selected before allowing a user to press a Button’

28
Aug

Styling a Flex Button control using embedded fonts

The following example shows how you can customize the appearance of a Flex Button control by using an embedded font and removing the Button’s default skin.

Full code after the jump.

Continue reading ‘Styling a Flex Button control using embedded fonts’

26
Aug

Changing a Button control’s text color

The following example shows how you can control the Button control’s text color using the color, disabledColor, textRollOverColor, and textSelectedColor styles.

Full code after the jump.

Continue reading ‘Changing a Button control’s text color’