Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hidding items from an array... 1

Status
Not open for further replies.

fedtrain

Instructor
Jun 23, 2004
142
US
(One of these days I'm going to get this without having to beg for help...GAH!!)

Ok...got an array of movie clips. Each clip has it's own instance name. I need to loop through the array and hide them all to start. (Later I will show some based on other stuff...)

Code:
var easyArray:Array = new Array ("g2Note","a2Note", "b2Note", "c2Note", "d2Note", "e2Note", "f2Note")
   trace (easyArray.length)
     for (i = 0; i<easyArray.length; i++){
       var hideNote = easyArray[i];
         if (hideNote._visible != false){
             hideNote._visible = false;
             trace ("got it");
         }
         else trace ("hidden");
    trace (hideNote)
  }

Now, the two traces for hideNote and 'got it' actually trigger. But the movies are never hidden. All I want is for everything in the array to be hidden. (This is complicated because there will be many arrays, and some reuse the same movie clips.)

"Credit belongs to the man who is actually in the arena - T.Roosevelt
 
line 1 is wrong....should be

var easyArray:Array = new Array (g2Note,a2Note, b2Note, c2Note, d2Note, e2Note, f2Note)


 
THANKS!! Not sure why, but I had it in my head I needed to list them as strings...but guess that is why they weren't being treated as objects.

Thanks.

"Credit belongs to the man who is actually in the arena - T.Roosevelt
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top