Posts Tagged ‘custom component’


Use SpriteVisualElement to implement a simple component in Flex 4

September 29, 2010. Posted by Andy Hulstkamp in Actionscript 3, flex 4. 3 Comments »
Keywords: , , ,

In Flex 4 the standard way to create a custom control is to extend from SkinnableComponent, then implement the handling and management of events and states there and use a separate skin class for the visual representation of the component.

A class that gets less attention, but might be useful in a couple of scenarios to create a control alternatively, is the SpriteVisualElement class.

This example shows an implementation of a simple ruler by extending the SpriteVisualElement.

Ruler implemented by extending SpriteVisualElement

The SpriteVisualElement

The SpriteVisualElement is a display object that can be used inside spark containers.

It inherits from Sprite and implements the (more…)


Updated components to Flex 4 sdk final

May 8, 2010. Posted by Andy Hulstkamp in flex 4. 12 Comments »
Keywords: , , ,

During the past year I’ve posted a couple of custom Gumbo (flex 4 beta) components and skins.

Since they’ve been built on beta sdks, these components might need some adjustments to work with the Flex 4 release sdk.

To save you the work of figuring out what to adjust here are the most requested components updated to Flex 4 release sdk. Click on the images, view source is enabled.

Flex 4 Spark Rating Component. View source enabled. Original post here.

Flex 4 Spark Rating Component

Flex 4 Spark Icon Button based on a generic skin.View source enabled. Original post here.

Flex 4 Spark Icon Button based on a generic skin

Flex 4 Spark icon button. View source enabled.Original post here.

Flex 4 Spark Icon Button

Flex 4 Spark custom checkbox. View source enabled. Original post here.

Flex 4 Spark custom checkbox

Flex 4 Spark custom knob button. View source enabled. Original post here.

Flex 4 Spark custom knob button


Custom PopUp Rating Component in Spark Flex 4 (Gumbo)

July 9, 2009. Posted by Andy Hulstkamp in FXG, Gumbo (Flex 4 beta). 14 Comments »
Keywords: , , , , , , , , ,

I was experimenting a little with the PopUpAnchor in Spark Flex 4 and came up with a new custom component for ratings. The new component has the following characteristics:

  • Show a placeholder-icon that reflects the current rating and serves as an interactive element to open the ratings
  • ratings pop up for adjustment
  • both the placeholder-icon and the ratings-icons will be gradually filled with color when adjustments are being made
  • the icons are defined in FXG
  • the icons are not defined in the skin but can be passed as a style for generic use (one skin for different icons and ratings)
  • there is colorization of the icons based on styles
  • smooth transitions when opening the ratings

Here’s a pseudo city-rating demo that shows variations of the component using different icons and color settings for different ratings.

City Rating Component

You’ll find the source at the end of this post. It is (more…)


Custom Spark CheckBox Component in Flex 4 (Gumbo)

Here’s an example of how to enhance the default Spark CheckBox. This example uses a mark for the unchecked states and one for the checked states. Some simple transitions are used to make things a little bit nicer.

Custom CheckBox Preview

The skin uses two additional properties (symbolColorChecked,  symbolColorUnchecked) for the (more…)


Custom Component in Flex 4 (Gumbo). A Knob Button - part 2.

February 26, 2009. Posted by Andy Hulstkamp in Actionscript 3, FXG, Gumbo (Flex 4 beta). 1 Comment »
Keywords: , , , , , , , ,

This post looked at creating a custom flex 4 component from scratch. The knob button defined there had a min/max-value for the range and the rotation. The user could adjust the value by pressing the knob and then dragging the mouse. Now, we would like to extend the control a bit by adding a text input-field where the value of the knob is reflected. Likewise a value can be entered into the textfield and the rotation of the knob would reflect this.

Instead of extending the knob I decided to create another control that is a composition (more…)