Use Array To apply eventListeners to numerous Buttons
I have this function that I want to apply to 10 different MovieClips that are on the stage by using an array. I wrote the array, I just need to know how I can apply the array to the function. Thank you
var sliceArray:Array=["slice1","slice2","slice3","slice4","slice5","slice6","slice7",
"slice8","slice9","slice10"];
btn1.addEventListener(MouseEvent.MOUSE_DOWN, sliderFunction)
btn1.addEventListener(MouseEvent.MOUSE_UP, sliderFunctionRelease)
function rotateMC(num:Number)
{
slice1.rotation+=num;
}
function sliderFunction(event:Event):void
{
stage.addEventListener(Event.ENTER_FRAME, onEnter)
}
function onEnter(event:Event):void
{
rotateMC(10);
}
function sliderFunctionRelease(event:Event):void
{
stage.removeEventListener(Event.ENTER_FRAME, onEnter);
}