For loop with multiple arrays and loader

Hi everyone,

I’m creating a full flash site using multiple swfs that open inside a main swf. The main swf is a menu with 6 mc buttons, each one has to open a specific swf into a loader and stay in the “down” state. I’ve done all this in separated files and succeded, but I can’t make them work all together… At the moment I have two arrays, one for the buttons e other for the swf, and I have the loader created. I also have a function with a for loop that controls the “down” state of the buttons. What I’m missing is for the loop for my other array (can be in the same function I guess) and make the swf’s to open inside the loader.
I feel like an unsuccessful Victor Frankenstein… does anyone has some enlightenment? please help making my script live! :frankenstein:

Here’s it is:

var buttonsArray : Array = [mc_01, mc_02, mc_03, mc_04, mc_05, mc_06];
var swfArray : Array = [“01.swf”, “02.swf”, “03.swf”, “04.swf”, “05.swf”, “06.swf”];
var container:Loader = new Loader();
addChild(container);
//
function setButtons():void {
for (var i:int=0; i<buttonsArray.length; i++) {
buttonsArray*.id = i;
buttonsArray*.buttonMode = true;
buttonsArray*.mouseChildren = false;
buttonsArray*.mouseEnabled = true;
buttonsArray*.addEventListener(MouseEvent.ROLL_OVER,playOver);
buttonsArray*.addEventListener(MouseEvent.ROLL_OUT,playOut);
buttonsArray*.addEventListener(MouseEvent.CLICK,doClick);
}
}
//
function playOver(event:MouseEvent):void {
event.currentTarget.gotoAndStop(“over”);
}
function playOut(event:MouseEvent):void {
event.currentTarget.gotoAndStop(“out”);
}
function doClick(event:MouseEvent):void {
var currentBtn:int = event.currentTarget.id;
setSelectedBtn(currentBtn);
}
function setSelectedBtn(id:int):void {
for (var i:int=0; i< buttonsArray.length; i++) {
if (id == i) {
buttonsArray*.gotoAndStop(“down”);
buttonsArray*.buttonMode = false;
buttonsArray*.mouseEnabled = false;
buttonsArray*.removeEventListener(MouseEvent.ROLL_OVER,playOver);
buttonsArray*.removeEventListener(MouseEvent.ROLL_OUT,playOut);
buttonsArray*.removeEventListener(MouseEvent.CLICK,doClick);
} else {
if (buttonsArray*.currentLabel ==“down”) {
buttonsArray*.gotoAndStop(“out”);
}
buttonsArray*.buttonMode = true;
buttonsArray*.mouseEnabled = true;
buttonsArray*.addEventListener(MouseEvent.ROLL_OVER,playOver);
buttonsArray*.addEventListener(MouseEvent.ROLL_OUT,playOut);
buttonsArray*.addEventListener(MouseEvent.CLICK,doClick);
}
}
}
setButtons();

Tks