# Variable passing across across movieclips

**URL:** <https://forum.kirupa.com/t/variable-passing-across-across-movieclips/23078>\
**Category:** flash\
**Created:** [June 12, 2003, 3:56pm UTC](https://forum.kirupa.com/t/variable-passing-across-across-movieclips/23078 "2003-06-12T15:56:33Z")\
**Posts on this page:** 4\
**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 12, 2003, 3:56pm UTC](https://forum.kirupa.com/t/variable-passing-across-across-movieclips/23078/1 "2003-06-12T15:56:33Z")

</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)

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");
}

```

}

Below is the trace that happens if this: \_root.nav.\_ourFirm.gotoAndPlay(“out”); happened. It works fine without the if stuff by the way.

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

Please find the .swf attached.

---

<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 12, 2003, 4:01pm UTC](https://forum.kirupa.com/t/variable-passing-across-across-movieclips/23078/2 "2003-06-12T16:01:25Z")

</div>

the swf does what you want it to on my computer, i think.  
the submenu doesnt stay open when you go to a different item

---

<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 12, 2003, 4:16pm UTC](https://forum.kirupa.com/t/variable-passing-across-across-movieclips/23078/3 "2003-06-12T16:16:16Z")

</div>

Mr clown man…

If you roll over the onepartnership button with the ourfirm sub nav not open it jumps open and then closes it, this is what I want to avoid…

Cheers

James

---

<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, 9:25pm UTC](https://forum.kirupa.com/t/variable-passing-across-across-movieclips/23078/4 "2003-06-13T21:25:32Z")

</div>

weird. can you post the fla?
