如何更改一个Flash滑动拇指图形拇指、图形、如何更改、Flash

2023-09-08 14:23:21 作者:梦境贩卖官

我有一个用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.