flex 引用皮肤

转:Flex4 自定义皮肤的使用方法


skinClass的使用方法:

【1, 属性引用】

<s:Application name="Spark_Application_skinClass_test"
        xmlns:fx="http://ns.adobe.com/mxml/2009"
        xmlns:s="library://ns.adobe.com/flex/spark"
        xmlns:mx="library://ns.adobe.com/flex/halo"
        skinClass="skins.CustomApplicationSkin">
</s:Application>
 
                   【CSS引入】
<fx:Style>
        @namespace s "library://ns.adobe.com/flex/spark";
 
        s|Application {
            skinClass: ClassReference("skins.CustomApplicationSkin");
        }
</fx:Style>

                     【动态皮肤】
<fx:Script>
        <![CDATA[
            import skins.CustomApplicationSkin;
 
            protected function btn_click(evt:MouseEvent):void {
                setStyle("skinClass", CustomApplicationSkin);
            }
        ]]>
</fx:Script>

 

你可能感兴趣的:(flex 引用皮肤)