# If Condition asking for two variables to be set

**URL:** <https://forum.kirupa.com/t/if-condition-asking-for-two-variables-to-be-set/148202>\
**Category:** Uncategorized\
**Created:** [May 17, 2005, 11:07pm UTC](https://forum.kirupa.com/t/if-condition-asking-for-two-variables-to-be-set/148202 "2005-05-17T23:07:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dualaud](https://avatars.discourse-cdn.com/v4/letter/d/b487fb/32.png) [@dualaud](https://forum.kirupa.com/u/dualaud)\
**Post date:** [May 17, 2005, 11:07pm UTC](https://forum.kirupa.com/t/if-condition-asking-for-two-variables-to-be-set/148202/1 "2005-05-17T23:07:05Z")

</div>

for i know that i often fail 😊when it comes to syntax, i thought i might ask how the syntax would be if i’d want to ask if two variables are set.  
say i’d want to let things happen if the variables \_root.move==1 and at the same time \_root.window==0. :h:

in this piece of code:

onClipEvent (enterFrame) {  
if (\_root.move == 1) {  
if (\_root.mainVarX == 0) {

```
    homeX = (-_root._xmouse*1)+328;
    homeY = (-_root._ymouse*1)+400;
   
} else {
    
homeX = (-_root.mainVarX);
homeY = (-_root.mainVarY);
    
}

thisX = _x;
thisY = _y;
diffX = homeX-thisX;
diffY = homeY-thisY;

if (_root.mainVarX == 0) {
    moveX = diffX/10;
    moveY = diffY/10;
} else {
    moveX = diffX/10;
    moveY = diffY/10;
}

    _y = thisY+moveY;
    _x = thisX+moveX;

```

}  
}

my problem is, that i let something scroll in front of a button on mouse release, and flash now thinks that i left the button and thinks it should fire up stuff that should happen on rollout, which shouldn’t when i mouse release on the button.

thanks for your help. i figured, i better ask before i go mad for two days 😜
