# Hide movieclips

**URL:** <https://forum.kirupa.com/t/hide-movieclips/120339>\
**Category:** Uncategorized\
**Created:** [August 23, 2004, 1:19pm UTC](https://forum.kirupa.com/t/hide-movieclips/120339 "2004-08-23T13:19:20Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Voccart](https://avatars.discourse-cdn.com/v4/letter/v/ea5d25/32.png) [@Voccart](https://forum.kirupa.com/u/Voccart)\
**Post date:** [August 23, 2004, 1:19pm UTC](https://forum.kirupa.com/t/hide-movieclips/120339/1 "2004-08-23T13:19:20Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![bwh2](https://avatars.discourse-cdn.com/v4/letter/b/8c91f0/32.png) [@bwh2](https://forum.kirupa.com/u/bwh2)\
**Post date:** [August 23, 2004, 2:10pm UTC](https://forum.kirupa.com/t/hide-movieclips/120339/2 "2004-08-23T14:10:01Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Voccart](https://avatars.discourse-cdn.com/v4/letter/v/ea5d25/32.png) [@Voccart](https://forum.kirupa.com/u/Voccart)\
**Post date:** [August 23, 2004, 2:15pm UTC](https://forum.kirupa.com/t/hide-movieclips/120339/3 "2004-08-23T14:15:52Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Uli](https://avatars.discourse-cdn.com/v4/letter/u/ccd318/32.png) [@Uli](https://forum.kirupa.com/u/Uli)\
**Post date:** [August 23, 2004, 3:05pm UTC](https://forum.kirupa.com/t/hide-movieclips/120339/4 "2004-08-23T15:05:12Z")

</div>

```php

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 🙂

---

<div class="post-metadata">

**Author:** ![Voccart](https://avatars.discourse-cdn.com/v4/letter/v/ea5d25/32.png) [@Voccart](https://forum.kirupa.com/u/Voccart)\
**Post date:** [August 23, 2004, 5:22pm UTC](https://forum.kirupa.com/t/hide-movieclips/120339/5 "2004-08-23T17:22:19Z")

</div>

```php
 
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

```php
_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

---

<div class="post-metadata">

**Author:** ![Voccart](https://avatars.discourse-cdn.com/v4/letter/v/ea5d25/32.png) [@Voccart](https://forum.kirupa.com/u/Voccart)\
**Post date:** [August 23, 2004, 8:10pm UTC](https://forum.kirupa.com/t/hide-movieclips/120339/6 "2004-08-23T20:10:00Z")

</div>

hehe okay, i got it allmost working :drool:

```auto
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

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

```

it works. is there something wrong with that line ?

thanks

---

<div class="post-metadata">

**Author:** ![Voccart](https://avatars.discourse-cdn.com/v4/letter/v/ea5d25/32.png) [@Voccart](https://forum.kirupa.com/u/Voccart)\
**Post date:** [August 25, 2004, 5:32pm UTC](https://forum.kirupa.com/t/hide-movieclips/120339/7 "2004-08-25T17:32:32Z")

</div>

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