Greetings,
I am trying to loop through several lines of code and replace certain parts of the variables with a number in a loop. You can see what I have here:
for (var j:int=0; j <= bootArray.length; j++) {
switch (j) {
case 1 :
bootBtnMC1.visible = true;
var imgPath1="_assets/img/ALII/ALII_" + bootArray[0] + "_thumb.png";
var loader1:Loader=new Loader;
var request1:URLRequest=new URLRequest(imgPath1);
loader1.load(request1);
MovieClip(root).bootBtnMC1.thumbImgMC.addChild(loader1);
break;
case 2 :
bootBtnMC2.visible = true;
var imgPath2="_assets/img/ALII/ALII_" + bootArray[1] + "_thumb.png";
var loader2:Loader=new Loader;
var request2:URLRequest=new URLRequest(imgPath2);
loader2.load(request2);
MovieClip(root).bootBtnMC2.thumbImgMC.addChild(loader2);
break;
Is there a way I can trim this down? I have these cases through 7. It works the way I have it but it’s obviously very poor coding. I know how to do it in AS2 but I just keep getting error after error in AS3.
Thanka a ton!
SP