# Boolean not working in a function

**URL:** <https://forum.kirupa.com/t/boolean-not-working-in-a-function/299102>\
**Category:** flash\
**Created:** [October 29, 2009, 6:45pm UTC](https://forum.kirupa.com/t/boolean-not-working-in-a-function/299102 "2009-10-29T18:45:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![decimal](https://avatars.discourse-cdn.com/v4/letter/d/e19adc/32.png) [@decimal](https://forum.kirupa.com/u/decimal)\
**Post date:** [October 29, 2009, 6:45pm UTC](https://forum.kirupa.com/t/boolean-not-working-in-a-function/299102/1 "2009-10-29T18:45:53Z")

</div>

I’ve been trying to get a flash map to zoom in and out but I can’t seem to get it working, it’ll zoom in fine, but not zoom out I’m zooming into a particular area of a map (Uganda in this example) with a function for a button, I’m using a boolean value to check if I am zoomed in and it registers whether it’s true or false (checking with a dynamic textbox).

Here’s the code:

```php
var upclose:Boolean = false; 
init(); 

function ugandaZoomIn() { 
    if (!upclose) { 
         
        var myHoriTween:Tween = new Tween(map, "_x", Strong.easeIn, _root.map._x, -3700, 1, true); 
        var myHoriTween:Tween = new Tween(map, "_y", Strong.easeIn, _root.map._y, -1750, 1, true); 
        var myHoriTween:Tween = new Tween(map, "_yscale", Strong.easeIn, _root.map._yscale, 1000, 1, true); 
        var myHoriTween:Tween = new Tween(map, "_xscale", Strong.easeIn, _root.map._xscale, 1000, 1, true); 
        var myHoriTween:Tween = new Tween(bubbles_ug, "_alpha", Strong.easeIn, 0, 100, 1.5, true); 
        _root.bubbles_ug.gotoAndStop(1); 
        _root.bubbles_mac.gotoAndStop(2); 
        _root.bubbles_uk.gotoAndStop(2); 
upclose = false; 

    } else { 
        var myHoriTween:Tween = new Tween(map, "_x", Strong.easeIn, _root.map._x, 160, 1, true); 
        var myHoriTween:Tween = new Tween(map, "_y", Strong.easeIn, _root.map._y, 8, 1, true); 
        var myHoriTween:Tween = new Tween(map, "_yscale", Strong.easeIn, _root.map._yscale, 100, 1, true); 
        var myHoriTween:Tween = new Tween(map, "_xscale", Strong.easeIn, _root.map._xscale, 100, 1, true); 
        _root.bubbles_ug.gotoAndStop(2); 
        _root.bubbles_mac.gotoAndStop(2); 
        _root.bubbles_uk.gotoAndStop(2); 
        _root.uk_map_btn.enabled=true; 
        _root.ug_map_btn.enabled=true; 
        _root.mac_map_btn.enabled=true; 
upclose = true; 
    } 
} 

function init() { 
_root.navigation.ug_hotspot.onRelease = ugandaZoomIn; 

}  

```

Any help is really appreciated, I’ll have no hair left if I can’t get this working tonight!
