I’m looking to make a slider bar reveal movie clips on my stage as you drag it along.
I’ve written some sloppy code that works, but isn’t smooth by any means. I basically put MCs on different frames on the timeline, and I want those MCs to fade in or out relative to where the pointer is on the bar. This was a workaround, what I think I need is a boolean solution, but I’m not familiar enough with AS to write one from scratch. Here is the code I have so far. Does anyone have any ideas?
slAlpha.minimum = 1;
slAlpha.maximum = 6;
slAlpha.liveDragging = true;
slAlpha.tickInterval = 1;
slAlpha.addEventListener(Event.CHANGE, sliderChanged);
function sliderChanged(evt:Event):void {
if(slAlpha.value < 2){
gotoAndStop ( 1 );
}
else if(slAlpha.value == 2){
gotoAndStop ( 2 );
}
else if(slAlpha.value == 3){
gotoAndStop (3);
}
}
Thanks for any help!!!