Skip navigation
anjemalo
Currently Being Moderated

for loop with movieclips

Dec 22, 2011 2:22 PM

Hello:

I have twenty movieclips on stage with these names:

g1

g2

g3

g4

....

 

How can I make invisible with a for loop, like

 

for (i = 1; i < 20; i++)

    {

      g+i.visible=false;       

    }

 

this that not work.

Can you help me, please?

 
Replies
  • kglad
    72,228 posts
    Jul 21, 2002
    Currently Being Moderated
    Dec 22, 2011 3:07 PM   in reply to anjemalo

    for ( var i:int = 1; i < 20; i++)

        {

          this["g"+i].visible=false;       

        }

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points