# Movieclip 'if' and 'var' control help request

**URL:** <https://forum.kirupa.com/t/movieclip-if-and-var-control-help-request/12887>\
**Category:** Uncategorized\
**Created:** [February 5, 2003, 8:22pm UTC](https://forum.kirupa.com/t/movieclip-if-and-var-control-help-request/12887 "2003-02-05T20:22:11Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![hugoz](https://avatars.discourse-cdn.com/v4/letter/h/51bf81/32.png) [@hugoz](https://forum.kirupa.com/u/hugoz)\
**Post date:** [February 5, 2003, 8:22pm UTC](https://forum.kirupa.com/t/movieclip-if-and-var-control-help-request/12887/1 "2003-02-05T20:22:11Z")

</div>

Hello all,

Newbie here. :crazy: \<-- Gives you and understanding of how ANY type of programming makes feel. :stunned: \<-- The effect you badass programmers and your actionscript skills have on me. Enough with intro and asskissing, on to my question:

I have 5 movie clips, each has 3 keyframes. From the first to the second it shows a menu entering the scene, from the second to the third it shows it exiting. All 5 MCs are equal. each key frame has a value, which i assigned like so:

//frame 1  
submenu1 = “X”;  
//frame 10  
submenu1 = “Y”;  
//frame 20  
submenu1 = “Z”;

I have 5 buttons, one to trigger each menu (MC). What i am trying to do here, is have only one menu open at a time. So when they click on menu 2 and menu 4 is open, it will simulteneaously do both functions. Here is what i have so far:

on (release){  
menusub2.gotoAndPlay(“1”);  
if (submenu1 = “Y”) {  
menusub1.gotoAndPlay(“11”);  
}else{  
menusub1.gotoAndStop();  
}  
}

Any help would be gold as I am a graphic designer ‘attempting’ to actionscript. Thanks and advanced.

–hz

---

<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:** [February 5, 2003, 11:18pm UTC](https://forum.kirupa.com/t/movieclip-if-and-var-control-help-request/12887/2 "2003-02-05T23:18:02Z")

</div>

i would use a loop to check all clips on their state (name them with a number like clip1, clip2…and use for i=1, i\<5,i++ ; if state==this, then clip_dothat else if state ==something else clip_doanotherthing …you get the idea?

---

<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:** [February 5, 2003, 11:33pm UTC](https://forum.kirupa.com/t/movieclip-if-and-var-control-help-request/12887/3 "2003-02-05T23:33:26Z")

</div>

Mr. Eyezberg,

Thanks for the reply, I’ve been stressing all week trying to learn actionscript just to do this task. Although in theory I have a very good idea of what you are saying, i have zero idea on how to format it… is there any skeleton/structure i can sample? Thanks again.

-hz

---

<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:** [February 6, 2003, 1:22am UTC](https://forum.kirupa.com/t/movieclip-if-and-var-control-help-request/12887/4 "2003-02-06T01:22:48Z")

</div>

I don’t fully get what your asking for, but maybe this will help.  
:phil:

---

<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:** [February 11, 2003, 2:23am UTC](https://forum.kirupa.com/t/movieclip-if-and-var-control-help-request/12887/5 "2003-02-11T02:23:57Z")

</div>

Waffe, can’t thank you enough for taking a crack at it. It’s almost what I need, but only imagine that it plays the reverse tween of the menu’s entrance after you click on another menu.

Basically:

If I click menu2 while menu1 is open, it will play menu2’s reverse tween and vice versa… except there are more than 2 menus… more like 1++… or 5, which ever comes first.

THANKS.:beam:
