[AS3] Skinning Flash Components – Part II
Posted by SikoTiko in Problems, tags: actionscript 3, component, skinning, SliderSkinning Slider Component
In a comment on my previous post [AS3] Skinning Flash Components I was asked to show how to change the size of the thumb of the Slider component. After some experiments with the component here is the way it can be done:
import fl.controls.Slider; var s:Slider = new Slider(); s.move(10,10); s.setSize(500,300); /*s.setStyle("thumbUpSkin", SliderThumbCustomSkin); s.setStyle("thumbDownSkin", SliderThumbCustomSkin); s.setStyle("thumbOverSkin", SliderThumbCustomSkin);*/ s.maximum = 100; s.minimum = 0; s.tickInterval = 5; addChild(s); s.getChildAt(1).width = 50; s.getChildAt(1).height = 100;
With the code above I found that the thumb of the Slider component is positioned at index 1 and can be reached by s.getChildAt(1) (where s is the instance of the Slider component). Then you can easily change its properties like Width, Height, etc.
Here is the list of the styles that can be used for skinning a Slider component:
Slider component styles
sliderTrackDisabledSkin
sliderTrackSkin
thumbDisabledSkin
thumbDownSkin
thumbOverSkin
thumbUpSkin
tickSkin


Entries (RSS)
Hey thx, this was really helpful!