Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to customise a HSlider in flex?

Tags:

apache-flex

I'm new to flex,and I want to change the image of HSlider,like this

enter image description here

What should I do?please give me a simple example.

like image 299
wtm Avatar asked May 04 '12 06:05

wtm


1 Answers

@RIAstar had a great answer. But there is a little problem - this orange part before thumb. AFAIK the easiest way to create skin like this is to add rect or more complicated figure in HSlider skin, that will change it's width according to thumb's x coordinate, i.e.

<s:Button id="track" left="0" right="0" top="0" bottom="0" minWidth="33" width="100" 
          tabEnabled="false"
          skinClass="spark.skins.spark.HSliderTrackSkin" />

<s:Rect width="{thumb.x + thumb.width/2}" height="{track.height}">
    <s:fill>
        <s:SolidColor color="0x00FF00" />
    </s:fill>
</s:Rect>

<s:Button id="thumb" top="0" bottom="0" width="11" height="11" 
          tabEnabled="false"
          skinClass="spark.skins.spark.HSliderThumbSkin" />
like image 158
Art Avatar answered Oct 06 '22 00:10

Art