flex4.5移动设备开发-自定义按钮
发布时间:2020-12-15 01:24:49 所属栏目:百科 来源:网络整理
导读:【转】 http://www.terrenceryan.com/blog/post.cfm/quick-and-dirty-skinning-of-a-flex-mobile-button 【效果如下】 package skins{import mx.events.FlexEvent; import spark.skins.mobile.ButtonSkin; public class DemoButton extends ButtonSkin{ //Im
【转】
http://www.terrenceryan.com/blog/post.cfm/quick-and-dirty-skinning-of-a-flex-mobile-button 【效果如下】 package skins { import mx.events.FlexEvent; import spark.skins.mobile.ButtonSkin; public class DemoButton extends ButtonSkin { //Import the new assets for the background of the button [Bindable] [Embed(source="/assets/filterbuttonDown.png")] private var down:Class; [Bindable] [Embed(source="/assets/filterbuttonUp.png")] private var up:Class; public function DemoButton() { super(); //Set the width and the height to the size of the image. width = 243; height = 103; } // Override this function to return our skin images and not the normal ones. override protected function getBorderClassForCurrentState():Class { if (currentState == "down"){ labelDisplay.setStyle("color",0xFFFFFF); return down; } else{ labelDisplay.setStyle("color",0x48250A); return up; } } // Override this function to prvent the button from drawing a background override protected function drawBackground(unscaledWidth:Number,unscaledHeight:Number):void{ } override protected function labelDisplay_valueCommitHandler(event:FlexEvent):void { //super.labelDisplay_valueCommitHandler(event); labelDisplayShadow.text = labelDisplay.text; labelDisplay.setStyle("fontFamily","Lions Den"); labelDisplay.setStyle("fontSize",40); labelDisplay.setStyle("fontWeight","normal"); labelDisplay.setStyle("color",0x48250A); labelDisplayShadow.setStyle("fontFamily","Lions Den"); labelDisplayShadow.setStyle("fontSize",40); labelDisplayShadow.setStyle("fontWeight","normal"); } } } (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- 【XML】xml封装方法
- ruby – `Module#singleton_class`的逆
- c# – 有没有办法防止NHibernate LINQ提供程序的布尔性能问
- React Native:target has has hash string’android-X’no
- Flutter 快捷开发 Mac Android Studio 篇
- xcodebuild命令工具,无需安装Xcode本身
- 解析XML文件(字符串)的方法-----SAXReader
- 使用boost :: python从C创建python collections.namedtuple
- VIEWS在PostgreSQL中占用多少空间?
- c# – 不应该如果(1 == null)导致错误?