# Controlling movieclips with an IF function

**URL:** <https://forum.kirupa.com/t/controlling-movieclips-with-an-if-function/37179>\
**Category:** flash\
**Created:** [December 6, 2003, 10:06pm UTC](https://forum.kirupa.com/t/controlling-movieclips-with-an-if-function/37179 "2003-12-06T22:06:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![w9914420](https://avatars.discourse-cdn.com/v4/letter/w/c0e974/32.png) [@w9914420](https://forum.kirupa.com/u/w9914420)\
**Post date:** [December 6, 2003, 10:06pm UTC](https://forum.kirupa.com/t/controlling-movieclips-with-an-if-function/37179/1 "2003-12-06T22:06:02Z")

</div>

Hi all i got a slight problem

I have created 3 movieclip buttons which have a total of 3 states each  
UP, OVER and Pressed.

What i am wanting to do is create a fuction that will change the state of an already pressed button back to its UP state. For example

Button one is press and will stay in its state untill button 2 or 3 are presses then it will revert back to its up state.

My way of tackling the problem was to target a frame in the movie clip that I wanted to change such as this:

on (rollOut) {  
gotoAndPlay(“ee”);  
}  
on (press) {  
gotoAndPlay(“dd”);  
}  
on (press) {  
\_root.jill.gotoAndPlay(52);  
}

as you can see nothing to it. but I then released that when I had more than two buttons using this fuction it then became obsolete due to the fact that the button would play a portion of the frame that I did not want to appear on screen.

I am a newbie to flash so complex scripting was not an option for me. Im not sure on how to approch this. I think an if statement is what i am looking for but how would you apply to this.

I want a statement that basically says for e.g

If button 1 is on the pressed state then when button 2 or 3 are pressed revert back to your up state (Im guessing i would have to apply this to all 3 buttons).

Ok thats it, If any one as any idea to how I can solve this pain in the neck or if anyone could point to any online tutorials that relate to my problem that would be great.

Thanks

w9914420

i have also included a sample of what i am working on
