# How do I check a value of a variable of a sibling movieclip?

**URL:** https://forum.kirupa.com/t/how-do-i-check-a-value-of-a-variable-of-a-sibling-movieclip/199614
**Category:** flash
**Created:** [September 4, 2006, 2:39pm UTC](https://forum.kirupa.com/t/how-do-i-check-a-value-of-a-variable-of-a-sibling-movieclip/199614 "2006-09-04T14:39:04Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Grudge](https://avatars.discourse-cdn.com/v4/letter/g/34f0e0/32.png) [@Grudge](https://forum.kirupa.com/u/Grudge)
#### Post date: [September 4, 2006, 2:39pm UTC](https://forum.kirupa.com/t/how-do-i-check-a-value-of-a-variable-of-a-sibling-movieclip/199614/1 "2006-09-04T14:39:04Z")

</div>

Let’s say I have a bunch of movieclips like this:

\_level0.mainmenu.item0\_mc  
\_level0.mainmenu.item1\_mc  
\_level0.mainmenu.item2\_mc  
\_level0.mainmenu.item3\_mc  
\_level0.mainmenu.submenu.item0\_mc  
\_level0.mainmenu.submenu.item1\_mc  
\_level0.mainmenu.submenu.item2\_mc  
\_level0.mainmenu.submenu.item3\_mc  
\_level0.mainmenu.submenu.submenu.item0\_mc  
\_level0.mainmenu.submenu.submenu.item1\_mc  
\_level0.mainmenu.submenu.submenu.item2\_mc  
\_level0.mainmenu.submenu.submenu.item3\_mc  
etc.

every movieclip has a attached variable (“expanded”) like this:

\_level0.mainmenu.item1\_mc.expanded == true

which can be set to true or false.

Each movieclip has a function attached to it that needs to know if any of it’s siblings (i.e item1\_mc, item2\_mc etc) have their “expanded” variable set to ‘true’.

What would be the easiest way to find that out? There can be any number of movieclips and any number of submenus.
