Question
objects appear & disappear with slider
I have a project with a map that has points that appear or
disappear based on the position of a slider.
For example, if the slider is within 10 units of 1000 (990-1010), show this point, otherwise hide that point.
What's the best way, in your opinions, to manage this?
So far, I have a change event listener on the slider that fires this function:
function sliderChange(e:SliderEvent):void {
if (e.target.value == 1500) {
makeBox();
}
}
MakeBox is a function that draws the rect that acts as my "point" (for now). This works but doesn't seem very scalable. So I'm seeking conceptual advice on the best way to make this handle a couple dozen points.
Thanks.
For example, if the slider is within 10 units of 1000 (990-1010), show this point, otherwise hide that point.
What's the best way, in your opinions, to manage this?
So far, I have a change event listener on the slider that fires this function:
function sliderChange(e:SliderEvent):void {
if (e.target.value == 1500) {
makeBox();
}
}
MakeBox is a function that draws the rect that acts as my "point" (for now). This works but doesn't seem very scalable. So I'm seeking conceptual advice on the best way to make this handle a couple dozen points.
Thanks.
