I'm trying to set a custom skin using the built-in AS3 slider component in Flash CS4. I have the following code, but setting myslider.width
and myslider.height
does not seem to have any effect. The slider is still displayed at the default width and height, and my custom sliderTrackSkin is being scaled down.
import fl.controls.Slider;
import fl.controls.SliderDirection;
import fl.events.SliderEvent;
var myslider:Slider = new Slider();
myslider.direction = SliderDirection.VERTICAL;
myslider.width = 43;
myslider.height = 110;
myslider.minimum = 1;
myslider.maximum = 90;
myslider.value = 30;
myslider.snapInterval = 1;
myslider.liveDragging = true;
myslider.addEventListener(SliderEvent.CHANGE, slider_change);
myslider.move(640, 60);
myslider.setStyle("thumbUpSkin", thumb1);
myslider.setStyle("thumbDownSkin", thumb1);
myslider.setStyle("thumbOverSkin", thumb1);
myslider.setStyle("sliderTrackSkin", slidertrack1);
addChild(myslider);
I would appreciate any advice. Thanks.