views:

17

answers:

1

I'm trying to copy/modify the spark skin for the default button, but not sure how to find that skin. When I hover over <s:Button and Ctrl + Click it, it takes me to the Button class, but there isn't any skin information there.

+1  A: 

The default button skin is in spark/skins/spark/ButtonSkin and subclasses Skin. Not sure why you would want to edit that way.

You can make a Skin Class out of a mxml file and reference it with the skinClass

<s:Skin 
xmlns:fx="http://ns.adobe.com/mxml/2009" 
xmlns:mx="library://ns.adobe.com/flex/mx" 
xmlns:s="library://ns.adobe.com/flex/spark" 
minWidth="21" minHeight="21">

<fx:Metadata>
    [HostComponent("spark.components.Button")]
</fx:Metadata> 

<s:states>
    <s:State name="up"/>
    <s:State name="over"/>
    <s:State name="down"/>
    <s:State name="disabled"/>
</s:states>

<s:Rect left="0" right="0" top="0" bottom="0" width="69" height="20" radiusX="2" radiusY="2">
    <s:stroke>
        <s:SolidColorStroke color="0x000000" weight="1"/>
    </s:stroke>
</s:Rect>

<s:Label id="labelDisplay" 
    alpha.up="1"
    alpha.down=".5"
    alpha.over=".25"
    horizontalCenter="0" verticalCenter="1"
    left="10" right="10" top="2" bottom="2">
</s:Label>
</s:Skin>

and in your main application

<s:Button label="Alpha Change" skinClass="mySkins.AlphaButtonSkin"/>
phwd