开发者

Flex: Disable range on Slider?

I have an HSlider with a minimum of 1 and a maximum of 6. Is there a way I can disable the range 3 - 6, so the user can only select from the range 1-3 on the slider.

Note: Your first thought might be to tell me to set the maximum to 3. I dont want to change the maximum to 3, I want the user to know ther开发者_JS百科e is more, but currently not selectable.

Thanks!!


I would try to override the getValueFromX method in Slider. It's marked mx_internal, so you'll need to add the necessary import and use statements.

As with the Event.CHANGE suggestion, it won't show a disabled UI for the remainder of the track, which would be ideal. For that you'll need to override more of Slider or draw your own component.


You can create a listener for the CHANGE event. When it sees that the new slider position is greater than 3, you can reset the slider to 3.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜