Using the SDK 4.1, I was able to access the custom properties of the custom button component from the custom skin. The project that I am currently running requires SDK 4.5 and I cannot access the properties. Here is an example:
Custom Button Component
<?xml version="1.0" encoding="utf-8"?>
<s:ButtonBase xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
skinClass="components.skins.ButtonIcon_Skin"
>
<fx:Declarations>
<fx:String id="iconCustom" />
</fx:Declarations>
</s:ButtonBase>
Custom skin
<?xml version="1.0" encoding="utf-8"?>
<s:SparkButtonSkin xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:fb="http://ns.adobe.com/flashbuilder/2009"
minWidth="21" minHeight="21"
alpha.disabled="0.5">
<fx:Metadata>[HostComponent("components.ButtonIcon")]</fx:Metadata>
...
<s:Label id="test" {hostComponent.iconCustom}"
horizontalCenter="0" bottom="10" />
</s:SparkButtonSkin>
The code hint shows hostComponent.iconCustom, but then gives an error:
Access of possibly undefined property iconCustom through a reference with static type spark.components.supportClasses:ButtonBase. ButtonIcon_Skin.mxml
Trist source
share