# Variables not working

**URL:** <https://forum.kirupa.com/t/variables-not-working/222380>\
**Category:** Uncategorized\
**Created:** [April 12, 2007, 9:04pm UTC](https://forum.kirupa.com/t/variables-not-working/222380 "2007-04-12T21:04:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![superbungalow](https://avatars.discourse-cdn.com/v4/letter/s/cab0a1/32.png) [@superbungalow](https://forum.kirupa.com/u/superbungalow)\
**Post date:** [April 12, 2007, 9:04pm UTC](https://forum.kirupa.com/t/variables-not-working/222380/1 "2007-04-12T21:04:25Z")

</div>

I have a variable (allowdraw) set to false originally. I have this code:

```auto

_root.water_btn.onRelease = function() {
    if (allowdraw == false) {
        allowdraw = true;
    } else {
        allowdraw = false
    }
};

```

It sets it to true when the button is released the first time, but won’t set it to false when I press it the second time. Can anyone help?
