View Full Version : Custom skinNames for custom states

02-04-2009, 10:08 AM
I'm desperately trying to implement custom states with skinnames, but i'm unable to get this to work.

The docs do not have much info about this.

Here's what i've got so far in a custom component derived from UIComponent:

[Style (name="fooSkin", type="Class", inherit="no", states="foo")]
[Style (name="barSkin", type="Class", inherit="no", states="bar")]

<mx:State name="foo"/>
<mx:State name="bar"/>

what i'd like to do is create a stateful skin that can use my custom states.
As far as i can tell from the builtin skin code, the skin class check's it's name in the updatedisplaylist function to determine how to draw itself.

I'm setting the style for the component as follows:

.myStyle {
fooSkin: ClassReference('MySkin');
barSkin: ClassReference('MySkin');

However, none of the code inside MySkin gets executed.

Anyone ever done this ?

03-04-2009, 01:36 AM
This might be a silly question, but in your ClassReference, is that your full class path to that skin object? Also while i cant see your full code, are you actually assigning your skin to that object? like upSkin: fooSkin?