[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!
Dude you’re a life saver, I’ve looked all over the net to try and do exactly this but this is the only article I’ve found that has lead me in the right direction.
Anyway I won’t have to pull my hair out on this one anymore.
Thanks!
Thank you so much for posting this! I tried the code and it worked great for what I needed. I was pulling my hair out also.
Thank you, thank you!!
Any ideas howto target the VolumeBar component Handle via as3?
I’m trying to tween the alpha of the component but the handle never takes on the alpha style, it just sits on top like it isn’t part of the component.
and if I say removeChild, when I addChild back again the handle is gone completely!