July 9, 2009. Posted by Andy Hulstkamp in
FXG,
Gumbo (Flex 4 beta).
5 Comments »
Keywords:
custom component,
effects,
FXG,
masking,
popup,
rating,
skin parts,
Spark,
states,
Transitions
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.

You’ll find the source at the end of this post. It is Read the rest of this entry »
June 20, 2009. Posted by Andy Hulstkamp in
Actionscript 3,
FXG,
Gumbo (Flex 4 beta).
10 Comments »
Keywords:
effects,
FXG,
generic,
Icons,
pseudo selectors,
skinning,
states,
Transitions
For the past couple of days I’ve had a look at creating Spark Icon Buttons. In this post I’ve created an FXG Icon Button with some transitions, leveraging pseudo selectors for states. The Icon was ‘hardcoded’ into the skin. For another Icon I would need to duplicate the skin and introduce another graphic. Not exactly generic. There are other ways to bring graphics into Spark Skins but none of them work with FXG Elements directly.
What I want is:
- work with FXG Graphic Elements for simpler manipulation and scaling
- easily export the FXG-Definitions for the icons from a tool and/or be able to change them in FB directly
- colorize the icons based on a color style-property and do this per state
- change the icons based on a style-property and do this per state
- change icons at runtime
- scaling effect on icon
- have ONE generic skin, so no duplicates for different icons are necessary
Most of the trouble with generic skins comes from the fact that there is no way to access the FXG Library-Definitions at run-time (as far as I know) - like getting an instance of a symbol in the library, the way we had in flash. Here’s a hack but I’d rather not use it.
After some headaches I finally managed to get a solution I can live with:

Click here for a test.
You’ll find the source at the end of this post.
The solution regarding the work flow mainly comes down to Read the rest of this entry »
It was funny to see how many examples of Spark Icon Buttons have shown up in the past few days. Andy mcintosh did an example here, Ben another one here, I did one myself here. While all were using a slightly different approach the motivation behind them was probably, that the Spark Button does not have an icon property compared to the Halo coutnerpart.
Out of the box there are basically three ways to get graphics into a Spark skin. Read the rest of this entry »
June 18, 2009. Posted by Andy Hulstkamp in
Actionscript 3,
FXG,
Gumbo (Flex 4 beta).
6 Comments »
Keywords:
advanced selectors,
animate,
AnimateColor,
button,
css,
effects,
Gradient,
Icon,
Pseudo,
Selectors,
Spark,
styles,
Transitions
update: Check this example for a more advanced and generic approach
Here’s an example of a Spark Icon Button done in Flex 4. There are smooth transitions on the background gradient between the up and over states. From the over state to the down state the shadows are removed smoothly. Each button has a different base color.

Click here for a demo.
Apart from the new skinning architecture there are a couple of Read the rest of this entry »
When working with huge amounts of data on DataGroup, SkinnableDataContainer and all its Subclasses you will notice degradation in performance. Manipulating Data becomes slower, the UI on the Groups become less responsive, startup suffers, footprint is huge. By default, Felx 4 creates an ItemRenderer for each data-item resulting in this overhead. Read the rest of this entry »
Here are some notes I took while investigating and reading about Spark Containers. Read the rest of this entry »
June 13, 2009. Posted by Andy Hulstkamp in
Actionscript 3,
Astro (Flash 10 beta),
FXG,
Gumbo (Flex 4 beta).
No Comments »
Keywords:
CheckBox,
custom component,
effects,
graphic,
skinning,
Spark,
states,
styles,
Transitions
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.

The skin uses two additional properties (symbolColorChecked, symbolColorUnchecked) for the Read the rest of this entry »
June 1, 2009. Posted by Andy Hulstkamp in
Actionscript 3,
FXG,
Flash,
Gumbo (Flex 4 beta),
Misc,
Sound.
6 Comments »
Keywords:
component,
customizing,
effects,
FXG,
skinning,
SkinState,
Spark,
Transition
Changing the look of a spark component mainly comes down to customizing the skin-class, but there are situations where this might not be enough.
In a project I’m working on, we wanted to have a smooth transition when a text-input gets or loses focus. The default Spark TextInput and the associated skin-class do not have a focused state. (In Flex the FocusManager manages the focus by drawing a border around a component, but we wanted the focus on the skin itself and a transition)

One way to achieve this is to enhance the TextInput Component: Read the rest of this entry »
May 28, 2009. Posted by Andy Hulstkamp in
Actionscript 3,
FXG,
Gumbo (Flex 4 beta).
2 Comments »
Keywords:
Definition,
element,
FXG,
graphic,
instance,
Library,
runtime,
symbol
Part of the FXG 1.0 specification in Flex 4 makes it possible to define elements inside a library. The elements can then be re-used in a FXG document:
<!--Library with the definitions -->
<Library>
<Definition name="circle">
<s:Ellipse x="0" y="0" width="100" height="100" >
<s:fill>
<s:SolidColor color="0x000000" />
</s:fill>
</s:Ellipse>
</Definition>
</Library>
<!-- use some instances of the definition -->
<circle/>
<circle x="200" y="100"/>
<circle x="300" y="100" height="75" width="75" />
As of now there is no way to create these symols at runtime. For example, if you’d like to create a starfield, you would need Read the rest of this entry »
March 12, 2009. Posted by Andy Hulstkamp in
Actionscript 3,
FXG,
Gumbo (Flex 4 beta).
No Comments »
Keywords:
component,
customizing,
flex 4,
gumbo,
mask,
masking,
skin parts,
skin states,
skinning
Here’s a simple rating component done in Flex 4 (Gumbo).
The skin uses two library definitions. One symbol for the active and one for the passive rating. The symbols are then placed in a passive and an active Group. A mask is used to show/hide the active group based on the rating. ActiveGroup/passiveGroup and mask are the required Skin-Parts.
The Component itself manages the rating and pushes this down to the mask by setting its width. The rating is exposed as a bindable property.
The following example usees the component with two different skins.

source is here (SDK 4.0.0.4932)