Skinning Sliders Flex

I've been working with a custom Slider extension (which selects a range of elements from a dataProvider, rather than numerics, plus a couple other little things), and got to skinning it this afternoon.  One of the design specs required different images for the two sliders, both pointing towards each other (i.e. mirror images of each other).  Obviously you can't do that with the single 'thumbSkin' style on Slider, so more digging was needed.

A quick look at the API docs shows that SliderThumb extends Button, and therefore inherits it's 'skin' style.  Except that you can't use it; it gets silently ignored.  After some digging around inside the Slider source, I found that the style names get realiased to be their "proper" names, with a 'thumb' prefix, so you actually need to use 'thumbSkin', just like you do on the Slider control itself.  It seems that instead of replicating the style attribute from the Slider to the SliderThumbs (using appropriate names), the whole Slider style definition is copied into the SliderThumbs.  I'd expect this [strange] behaviour to be the same for other auto-created elements (headers in DataGrids, etc.) as well, so watch out, because there is no documentation except digging through the framework source.

Comments are closed.