Assigning differnt values to slider bar
Hi,
Im really new to actionscript so hopefuly im making sense, on the project im doing now i have a slider bar taken from the compnents in flash. What i want is to duplicate a movie clip i have on the stage randomly with in a nother movie clip called square_mc. I have the movie clip spawning accoring to the slider value.
But what i want to happen is to sapwn the movie to a custom number assignd to certian incraments of the slider, instead of it spawn 1-11, which are my slider values. And each interval i go up the slider i want it to reset, so for e.g. the first incrament of the slider value is 2 and the second is 5, when i slide to the second one i only want 5 movie clips not 7.
This is the code i currently have.
timeline_slider.addEventListener(SliderEvent.CHANGE, dotspawn);
}
function dotspawn(e:SliderEvent)
{
for( var i = -1; i < timeline_slider.value; i++ )
{
var rd = new red_dot();
addChild( rd );
rd.x = square_mc.x + Math.random()* square_mc.width;
rd.y = square_mc.y + Math.random()* square_mc.height;
}
update(0);// do initial update;
update(e.value);
}
Thanks,
hen