You can also access other properties on the 'parent' component that the
skin is attached to if they are bindable as well.
{hostComponent.whateverHere}

And of course for custom components/custom skins you can define the host
component's type via [HostComponent()] metadata inside the skin's
fx:Metadata tag.

Mobile skins used to be quite important to try to avoid bindings in and
instead use actionscript based skins. But they might even be ok with using
mxml and bindings in today's mobile devices.
A lot of things got so much faster simply by time going by.
It's been a while since I used Flex 4 skinning now. Miss it a lot!


On Mon, Dec 30, 2019 at 4:18 PM bilbosax <waspenc...@comcast.net> wrote:

> Alex, to be honest, I have become accustomed to avoiding binding
> expressions
> due to performance hits, especially with large array collections and
> dataproviders.  I have become sooooo accustomed to doing this, that it
> didn't even cross my mind.  But a binding expressions are brilliant in this
> situation and streamlines the process considerably, getting rid of two
> unneccessary methods and a timing mechanism that can't be 100% relied
> upon.
> Thanks for this simple but very useful solution.  Here is what the skin
> code
> looks like now:
>
> <?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="20" minHeight="20"
>                                    alpha.disabled="0.5"
> xmlns:fxgAssets="fxgAssets.*">
>
>         <fx:Metadata>
>
>         </fx:Metadata>
>
>
>         <s:states>
>                 <s:State name="up" />
>                 <s:State name="over" />
>                 <s:State name="down" />
>                 <s:State name="disabled" />
>         </s:states>
>
>         <s:Rect id="buttonRect" width="100%" height="100%"
> bottomLeftRadiusX="{height/2}" bottomLeftRadiusY="{height/2}"
> bottomRightRadiusX="{height/2}" bottomRightRadiusY="{height/2}"
> topLeftRadiusX="{height/2}" topLeftRadiusY="{height/2}"
> topRightRadiusX="{height/2}" topRightRadiusY="{height/2}">
>                 <s:fill>
>                         <s:SolidColor color.up="#2B8D00"
> color.down="#323233"/>
>                 </s:fill>
>         </s:Rect>
>         <s:Label id="labelDisplay" color="#FAFAFA" styleName="titleMedium"
> fontWeight="bold" horizontalCenter="0" verticalCenter="0"/>
>         <s:Rect width="100%" height="100%" alpha="0" includeIn="up, over,
> down,
> disabled">
>                 <s:fill>
>                         <s:SolidColor color="#FFFFFF"/>
>                 </s:fill>
>         </s:Rect>
>
> </s:SparkButtonSkin>
>
>
>
> --
> Sent from: http://apache-flex-users.2333346.n4.nabble.com/
>

Reply via email to