hi,
i'm currently trying to skin a couple of my components using degrafa. most of the sample code uses buttons and their pre-defined flex states like overSkin, downSkin, selectedUpSkin etc.
In my case i'd need much more different states which are available for the button, that's why i would need to implement my own custom states.
The adobe docs say you can define your custom states like this:
Code:
[Style(name="mySkin", type="Class", inherit="no", states="foo, bar")
The test component i've written looks like that now:
Code:
<?xml version="1.0" encoding="utf-8"?>
<mx:UIComponent xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:Metadata>
[Style(name="mySkin", type="Class", inherit="no", states="foo, bar")]
</mx:Metadata>
<mx:states>
<mx:State name="foo"/>
<mx:State name="bar"/>
</mx:states>
</mx:UIComponent>
Here's the part of the degrafa skin:
Code:
<geometry>
<GeometryComposition state="bar">
<RegularRectangle fill="{solidFill}" height="{aheight}" width="{awidth}"/>
<RegularRectangle fill="{diagFill}" height="{aheight}" width="{awidth}"/>
</GeometryComposition>
<GeometryComposition state="foo">
<RegularRectangle fill="{solidFill}" height="{aheight}" width="{awidth}"/>
<RegularRectangle fill="{diagFill}" height="{aheight}" width="{awidth}"/>
</GeometryComposition>
</geometry>
Unfortunately, when applying the skin to the component using mySkin="myDegrafaSkinClass", no skin is applied to it.
It works without any problem if i use the pre-defined states, ie if i use the button and use the overSkin etc states.
Anyone knows how this is done ?
thanks!