Creating a custom SkinnableComponent in Flex 4

January 19, 2011

Creating skins in Flex 4 for existing components  such as the scrollbar (see last post) turns out to be fairly easy. Creating components that can be skinned is pretty easy as well. Here’s my take on it (View Source enabled):

Skinnable Component Example

When you drag a picture into the canvas area, a Stamp object is created, which uses a StampSkin to handle display and user interface. The Stamp class lays down the requirements it expects from the skin using the metatag [SkinPart(“true”)], and the StampSkin component handles the display and user input. It’s a nice separation between data and UI.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: