# \[MX\] If statement isn't working

**URL:** https://forum.kirupa.com/t/mx-if-statement-isnt-working/48724
**Category:** flash
**Created:** [April 16, 2004, 6:58am UTC](https://forum.kirupa.com/t/mx-if-statement-isnt-working/48724 "2004-04-16T06:58:45Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![dboers](https://avatars.discourse-cdn.com/v4/letter/d/bbe5ce/32.png) [@dboers](https://forum.kirupa.com/u/dboers)
#### Post date: [April 16, 2004, 6:58am UTC](https://forum.kirupa.com/t/mx-if-statement-isnt-working/48724/1 "2004-04-16T06:58:45Z")

</div>

I have the following [color=blue]if [/color]statement:

```auto
btn2.onRelease = function(){
btn1.yPos (30);
btn3.yPos (30);
if (btn1._y == 30 ){
mc1.scale (110);
mc2.scale (390);
if (mc1._width == 110 && mc2._width == 390){
this.yPos (50);
}
}
} 

```

to accomplish that one event is waiting for the other to finish before it starts, but it isn’t working.

This is the entire code:

```auto
MovieClip.prototype.yPos = function(y){
this.onEnterFrame = function(){
this._y += (y - this._y)/3;
if (this._y > y - 1 && this._y < y + 1){
delete this.onEnterFrame;
}
}
}
MovieClip.prototype.scale = function(w){
this.onEnterFrame = function () {
this._width += (w - this._width)/5;
if (this._width > w - 1 && this._width < w + 1) {
delete this.onEnterFrame;
btn1.yPos(50);
}
}
}
btn2.onRelease = function(){
btn1.yPos (30);
btn3.yPos (30);
if (btn1._y == 30 ){
mc1.scale (110);
mc2.scale (390);
if (mc1._width == 110 && mc2._width == 390){
this.yPos (50);
}
}
}
mc1.scale (50);
mc2.scale (450);

```

What is wrong with the [color=blue]if [/color]statement :h:
