Hide movieclips

Hi people,
i have the following movieclips running

_level0categories0_mc

  • level0.categories_mc.categorie0_mc.index0_mc
  • level0.categories_mc.categorie0_mc.index1_mc
  • level0.categories_mc.categorie0_mc.index2_mc

_level0categories1_mc

  • level0.categories_mc.categorie1_mc.index3_mc
  • level0.categories_mc.categorie1_mc.index4_mc
  • level0.categories_mc.categorie1_mc.index5_mc

_level0categories2_mc

  • level0.categories_mc.categorie2_mc.index6_mc
  • level0.categories_mc.categorie2_mc.index7_mc
  • level0.categories_mc.categorie2_mc.index8_mc
  • level0.categories_mc.categorie2_mc.index9_mc
  • level0.categories_mc.categorie2_mc.index10_mc

my question is: when i click a button in …for example…
…_level0categories1_mc… i need to know wich indexe’s there are and hide those movieclips. so in this case index3, index4 and index5
can someone please help me with this?

thanks

on(release){
level0.categories_mc.categorie0_mc.index3_mc._visible=false;
level0.categories_mc.categorie0_mc.index4_mc._visible=false;
level0.categories_mc.categorie0_mc.index5_mc._visible=false;
}

i think that’s what you’re getting at

thanks bwh2,

but there is one small prob… i dont know wich indexe’s there are in the level0.categories_mc.categorie0_mc… now there are three indexes tomorrow there can be 5 indexes

so i need to find out wich indexes there are and then hide those indexes

thanks for your help


for(var i in _root){
if(typeof (_root*) == 'movieclip' && _root*.substr(35,5) == "index"){
			_root*._visible = false;
//will hide all MCs on root with "index" as substring (35,5)
		}
	}

maybe something like that :slight_smile:

 
var NewID = id - 1;
var CatToHideID = "category"+NewID+"_mc";
 
for(var i in _root.categories_mc[CatToHideID]){ 
// trace (i) result is...................
// index5_mc
// index4_mc
// index3_mc
// index2_mc
// index1_mc
// index0_mc
// title_mc
// CatCollapse_btn
// changeIndexHeight
// ReorderCat
// HideCat
// UnhideCat
// title_mc
// id_mc
// ....................................................
 
if(typeof (_root.categories_mc[CatToHideID]*) == 'movieclip' && _root.categories_mc[CatToHideID]*.substr(35,5) == "index"){ 
			_root.categories_mc[CatToHideID]*._visible = false; 
//will hide all MCs on root with "index" as substring (35,5) 
		} 
	} 
 

The above code is allmost good. the only thing not working is

_root.categories_mc[CatToHideID]*.substr(35,5) == "index"

i did try diff things and no result… i need to be shure that the movieclip to hide the same is as “index” can someone help me with this please…

thanks

hehe okay, i got it allmost working :drool:

for(var i in _root.categories_mc[CatToHideID]){ 
// trace i result is: index0_mc, index1_mc, index2_mc, title and id
if(typeof (_root.categories_mc[CatToHideID]*) == 'movieclip' && _root.categories_mc[CatToHideID]*.substr(35,5) == "index"){ 
_root.categories_mc[CatToHideID]*._visible = false; 
//will hide all MCs on root with "index" as substring (35,5) 
} 
} 

when if i leave it like this nothing happens, but when i delete

&& _root.categories_mc[CatToHideID]*.substr(35,5) == "index"

it works. is there something wrong with that line ?

thanks

bump, oink, boink or whatever :d please someone?