Archive for June, 2008

30
Jun

Playing a sound effect when a ProgressBar control completes in Flex

In a previous example, “Setting a complete effect on a ProgressBar control in Flex”, we saw how you could apply an effect that plays once a Flex ProgressBar control completes (reaches 100%).

The following code shows how you can play an embedded sound effect once a Flex ProgressBar control completes using the mx.effects SoundEffect class and the ProgressBar class’s completeEffect effect/style.

Full code after the jump.

Continue reading ‘Playing a sound effect when a ProgressBar control completes in Flex’

29
Jun

Setting a complete effect on an Image control in Flex

The following example shows how you can add a complete effect on a Flex Image control by setting the completeEffect effect using MXML, CSS, or ActionScript.

Full code after the jump.

Continue reading ‘Setting a complete effect on an Image control in Flex’

29
Jun

Preventing an image from automatically loading in an Image control in Flex

The following example shows how you can prevent the Flex Image control to automatically loading an image when setting the Image control’s source property by setting the autoLoad property to false and then explicitly loading the image using the load() method.

Full code after the jump.

Continue reading ‘Preventing an image from automatically loading in an Image control in Flex’

28
Jun

Maintaining an image’s aspect ratio on an Image control in Flex

The following example shows how you can maintain a loaded image’s original aspect ratio on a Flex Image control by setting the maintainAspectRatio property.

Full code after the jump.

Continue reading ‘Maintaining an image’s aspect ratio on an Image control in Flex’

27
Jun

Detecting when the source changes on an Image control in Flex

The following example shows how you can detect when the source property has changed on a Flex Image control using the sourceChanged event.

Full code after the jump.

Continue reading ‘Detecting when the source changes on an Image 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’

25
Jun

Detecting when a RadioButtonGroup has been enabled or disabled in Flex

In a previous example, “Enabling and disabling RadioButton controls in a RadioButtonGroup in Flex”, we saw how you can enable or disable all of the RadioButton controls in a Flex RadioButtonGroup by setting the enabled property.

The following example shows how you can detect when the enabled property changes by using the enabledChanged event.

Full code after the jump.

Continue reading ‘Detecting when a RadioButtonGroup has been enabled or disabled in Flex’

24
Jun

Detecting a double click on a TextInput control in Flex

The following example shows how you can detect when a user double clicks a Flex TextInput control using the doubleClick event.

Full code after the jump.

Continue reading ‘Detecting a double click on a TextInput control in Flex’

23
Jun

Disabling keyboard navigation on the RadioButton control in Flex

The following example shows how you can disable keyboard navigation within a Flex RadioButton/RadioButtonGroup by extending the RadioButton class and overriding the protected keyDownHandler() method.

Full code after the jump.

Continue reading ‘Disabling keyboard navigation on the RadioButton control in Flex’

22
Jun

Setting a creation complete effect on an Accordion container in Flex

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

Full code after the jump.

Continue reading ‘Setting a creation complete effect on an Accordion container in Flex’

21
Jun

Detecting when a RadioButton has been clicked in a RadioButtonGroup in Flex

The following example shows how you can detect when a RadioButton has been clicked in a FlexRadioButtonGroup by listening for the itemClick event.

Full code after the jump.

Continue reading ‘Detecting when a RadioButton has been clicked in a RadioButtonGroup in Flex’

20
Jun

Looping over RadioButton controls in a RadioButtonGroup in Flex

The following example shows how you can loop over the RadioButton controls in a Flex RadioButtonGroup by using the numRadioButtons property and getRadioButtonAt() method.

Full code after the jump.

Continue reading ‘Looping over RadioButton controls in a RadioButtonGroup in Flex’

19
Jun

Enabling and disabling RadioButton controls in a RadioButtonGroup in Flex

The following example shows how you can set the visibility of all of the RadioButton controls in a Flex RadioButtonGroup by setting the enabled property.

Full code after the jump.

Continue reading ‘Enabling and disabling RadioButton controls in a RadioButtonGroup in Flex’

19
Jun

Setting the label placement on a RadioButtonGroup in Flex

The following example shows how you can set the label placement on a series of RadioButton controls in a Flex RadioButtonGroup by setting the labelPlacement property.

Full code after the jump.

Continue reading ‘Setting the label placement on a RadioButtonGroup in Flex’