5 Replies Latest reply on Feb 26, 2010 6:32 AM by Ned Murphy

    Little question about looping through mc# instances in the stage

    ankhcomm Level 1

      Probably a silly question, but it's something that's always been an issue for me.


      I have 17 different CheckBox component instances in the Stage (simulating an application for my company - don't ask as to why it must have so many CB's at once :grumble:).


      Anyway, I set a CSSStyleDeclaration to set their style, and I want a for loop to take care of it.


      My loops looks like this


      for (z = 0; z < 16; z++) {

           cb[z].setStyle("styleName", "cssCBstyle");




      But it isn't working. I know the problem is with the way I'm setting the reference to the CheckBox components as cb[z]. So, how do I do that the right way? I mean there has to be a right way to do it, just like navigating within an XML by using a loop with something like firstChild.childNodes[z], right?