The Difference Between Skin and SparkSkin

When learning and looking at Spark Skinning I noticed that some skins where made from the Skin class and some where based from the SparkSkin.

I found this really confusing mainly because I wanted a clear definition in my mind as to when I use one over the other. So I tracked down Deepa and asked her. The answer she gave was..

Use SparkSkin when you are planning on doing styles, and Skin when you are not.


More information on Skins
To start looking at the details, Group dervices from UIComponent, and Skin derives from Group and SparkSkin derives from Skin.

Details
All classes that subclass UIComponent have the getStyle() method.

The Skin class is the most lightweight class to include the HostComponent functionality.

The SparkSkin class includes arrays to effect the child component’s styles.

Override the updateDisplayList() function to include your own styles.

Share

Comments (7)

Derek NugentJune 2nd, 2010 at 12:07 pm

Hello there

I was wondering what I need to get started with Flex… I’ve been developing with Flash for quite some time. Do I need Flash Builder to get started?

Sorry for such a newbie question…
I’m not even a newbie yet!

Jonathan CamposJune 2nd, 2010 at 1:19 pm

There are lots of places to start. I would recommend downloading Flash Builder and start off with the 90 day trial and see what you think.

John BaileyJune 8th, 2010 at 10:56 am

This is really interesting. I’ve been cheating and using the right-click —> New —> New Skin way of doing it. I didn’t even know there is/was a SparkSkin. I have noticed issues that I’ve had with doing styling with Skin. Perhaps using SparkSkin will resolve those issues. Do you know of any examples or documentation out there showing the differences?

Jonathan CamposJune 8th, 2010 at 11:22 am

@John the only examples I can think of are within the flex framework. Some components use Skin and some use SparkSkin. Sorry I can’t be more specific. What exactly might you be looking for?

John BaileyJune 8th, 2010 at 11:28 am

@campos All good. I’m just looking to study-up on it more and understand the differences. Heck, perhaps I should dig around and then post my findings — probably not but it’s an idea :D

MattJune 15th, 2010 at 2:03 am

@Derek I recommend you start at the Flex in a week page on Adobe Developer Connection to learn Flex. Flex Builder is introduced too and much more

This is the link http://www.adobe.com/devnet/flex/videotraining/

Sameera ThilakasiriDecember 5th, 2010 at 5:09 am

Thanks, you talk to right point.

Leave a comment

Your comment