# If running inside onRelease when it shouldn't

**URL:** <https://forum.kirupa.com/t/if-running-inside-onrelease-when-it-shouldnt/192995>\
**Category:** Uncategorized\
**Created:** [July 3, 2006, 2:25pm UTC](https://forum.kirupa.com/t/if-running-inside-onrelease-when-it-shouldnt/192995 "2006-07-03T14:25:47Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![saveth](https://avatars.discourse-cdn.com/v4/letter/s/7c8e57/32.png) [@saveth](https://forum.kirupa.com/u/saveth)\
**Post date:** [July 3, 2006, 2:25pm UTC](https://forum.kirupa.com/t/if-running-inside-onrelease-when-it-shouldnt/192995/1 "2006-07-03T14:25:47Z")

</div>

For some reason the code below allows the if statement to run when I do a onRelease. Any idea why it is actually getting into the if statement. I traced out helton before it reaches the if and it says 2.

Thanks,  
Saveth

```auto
for (i=0; i<=thumbCount; i++) {
        _root.worldMc["th"+i].onRelease = function() {
            var helton:Number = 2;
            if (helton=1) {
                trace("hit");
                currentButton.loader_mc.gotoAndStop(1);
                currentButton = this;
                rotate = this.angle;
                clip = this;
                this.loader_mc.gotoAndPlay(1);
                clearInterval(rotateInterval);
                clearInterval(restartInterval);
                restartInterval = setInterval(startInterval, 15000);
            }
        };
    }

```
