如何更改一个Flash滑动拇指图形 [英] How to change the thumb graphic on a Flash slider

查看:166
本文介绍了如何更改一个Flash滑动拇指图形的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个用AS3动态创建的滑块。我可以通过引用拇指s.getChildAt(1)(即我花了相当长的一段弄清楚!)

I have a dynamically created slider with AS3. I can reference the thumb by s.getChildAt(1) (that took me quite a while to figure out!)

不过,我将如何分配一个新的图形呢?

But, how would I assign a new graphic to it?

推荐答案

Slider类是子类,UIComponent的有方法设置样式为组件(使用setStyle(风格的各个部分:字符串值:对象):无效)。 Slider类有不同的设置可以风格和thumbSkins也在其中。以下是几个人的名单:

Slider class is subclass of UIComponent which has method for setting styles for various parts of the component (setStyle(style:String, value:Object):void). Slider class has various set-able styles, and thumbSkins are among them. Following is the list of few of them:

protected static var defaultStyles:Object = {
    		thumbUpSkin: "SliderThumb_upSkin",
    		thumbOverSkin : "SliderThumb_overSkin", 
    		thumbDownSkin: "SliderThumb_downSkin",
    		thumbDisabledSkin: "SliderThumb_disabledSkin",
    		sliderTrackSkin: "SliderTrack_skin",
    		sliderTrackDisabledSkin: "SliderTrack_disabledSkin",
    		tickSkin: "SliderTick_skin",
    		focusRectSkin:null,
    		focusRectPadding:null
    	}

所以,你需要做的是叫 s.setStyle(thumbUpSkin,thumbUpSkinShape)。 thumbUpSkinShape是新的图形等形状的对象。如果您更感兴趣的事情是如何发生的,你可以看看源文件。你可以在CS3_InstallationDir找到它们\ EN \配置\组件源\的ActionScript 3.0 \用户界面\佛罗里达州\控制\。希望它能帮助。

So what you need to do is to call s.setStyle("thumbUpSkin", thumbUpSkinShape). thumbUpSkinShape is Shape object with new graphic and so on. If you are more interested in how things happen, you can look into source files. You can find them at CS3_InstallationDir\en\Configuration\Component Source\ActionScript 3.0\User Interface\fl\controls\. Hope it helps.

这篇关于如何更改一个Flash滑动拇指图形的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆