# Problems with IF and variable passing across movieclips

**URL:** <https://forum.kirupa.com/t/problems-with-if-and-variable-passing-across-movieclips/23142>\
**Category:** flash\
**Created:** [June 13, 2003, 2:24pm UTC](https://forum.kirupa.com/t/problems-with-if-and-variable-passing-across-movieclips/23142 "2003-06-13T14:24:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jamesblue](https://avatars.discourse-cdn.com/v4/letter/j/74df32/32.png) [@jamesblue](https://forum.kirupa.com/u/jamesblue)\
**Post date:** [June 13, 2003, 2:24pm UTC](https://forum.kirupa.com/t/problems-with-if-and-variable-passing-across-movieclips/23142/1 "2003-06-13T14:24:57Z")

</div>

Can anyone help me please?

I have six movie clips, in a navigation movie clip, on the main time line, here they are:

\_root.nav.\_home  
\_root.nav.\_ourFirm  
\_root.nav.\_onepartnership  
\_root.nav.\_services  
\_root.nav.\_career  
\_root.nav.\_contactus

In \_root.nav.\_ourFirm it has a sub navigation which when open passes a variable called menu.

when opened menu = “open”  
when closed menu = “closed”

(the variable comes through fine, I’ve traced it)

var menu = “closed”;  
trace(\_root.nav.\_ourFirm.menu);

I’m trying to get the other clips to close the sub menu, if the menu variable passed is open and do nothing if the variable has not been set or is “closed” but I cannot do it… Ahhhhh!!! Sob, sob… Please help me…

This is what I’ve tried on a button within the \_root.nav.\_onepartnership clip for instance

on (rollOver) {

if (\_root.nav.\_ourFirm.menu == open) {  
\_root.nav.\_ourFirm.gotoAndPlay(“out”);  
}

}

It looks like it works in the .swf but the nav sections pop up the sub nav and close it when it’s not open, that is the problem.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [June 13, 2003, 7:32pm UTC](https://forum.kirupa.com/t/problems-with-if-and-variable-passing-across-movieclips/23142/2 "2003-06-13T19:32:04Z")

</div>

not very usefull to get a look at the swf & not the code…  
anyway, i think from the looks that your pb is in sending  
ourFirm.gotoAndPlay(“out”); which i guess should hapen only if menu == open, even when menu != open, but as to why that happens…?  
i’d have to see your code.
