# Problem with using \_global vars

**URL:** https://forum.kirupa.com/t/problem-with-using--global-vars/197784
**Category:** flash
**Created:** [August 19, 2006, 2:02am UTC](https://forum.kirupa.com/t/problem-with-using--global-vars/197784 "2006-08-19T02:02:35Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![jbailey](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/jbailey/32/2380_2.png) [@jbailey](https://forum.kirupa.com/u/jbailey)
#### Post date: [August 19, 2006, 2:02am UTC](https://forum.kirupa.com/t/problem-with-using--global-vars/197784/1 "2006-08-19T02:02:35Z")

</div>

I set

```auto

_global.picWmax = 436;

```

But when I call the imageSize function with the if statement it doesn’t work.

```auto

function image(){

if (picture._width > picWmax){
       //do that thing;
}
else{
     //do default}
}

```

do that thing happens everytime regardless of size. However if I use

```auto

if (picture._width > 436){
       //do that thing;
}
else{
   //do default
}

```

Default only happens if the picture is less than 436.

**Why?**
