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!

few lines of code better than many 1

Status
Not open for further replies.

tanatos

Programmer
Sep 7, 2003
17
ES
I want eight instances of eight mc's to appear invisible on the scene when a button is clicked. Instead of on release....visible= falsebla, bla... eight times, i'd like to choose a most inteligent way to get it, with very few lines of code if possible. But, as i'm not very clever with actionscript, i claim for experts help - i know they're really are -.
Thanks in advance.
 
This will do it as long as your movieclips are named with a numeric index (myMc1, myMc2... thru myMc8)

Code:
on(release){
  for(var i=1;i<=8;i++){
    this['myMc'+i]._visible=false;
  }
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top