JD Isaacks
JD Isaacks

Reputation: 57974

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 there is more, but currently not selectable.

Thanks!!

Upvotes: 0

Views: 582

Answers (2)

Michael Brewer-Davis
Michael Brewer-Davis

Reputation: 14276

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.

Upvotes: 2

CookieOfFortune
CookieOfFortune

Reputation: 13974

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.

Upvotes: 0

Related Questions