# Help with conditionals AS2

**URL:** <https://forum.kirupa.com/t/help-with-conditionals-as2/278663>\
**Category:** flash\
**Created:** [January 3, 2009, 8:08am UTC](https://forum.kirupa.com/t/help-with-conditionals-as2/278663 "2009-01-03T08:08:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![wmsrite](https://avatars.discourse-cdn.com/v4/letter/w/9e8a1a/32.png) [@wmsrite](https://forum.kirupa.com/u/wmsrite)\
**Post date:** [January 3, 2009, 8:08am UTC](https://forum.kirupa.com/t/help-with-conditionals-as2/278663/1 "2009-01-03T08:08:08Z")

</div>

I’m trying to limit the range with which a movieclip can be moved on the stage using the mc\_name.\_y = mc\_name.\_y + 10.

I’m thinking of using a if/else statement but I can’t figure out the proper way to write the code.

I don’t want my movieclip to be able to be moved off the stage completely.

Any help would be much appreciated.

Thanks,  
Will  
Source files are too big to attach, but can be downloaded here:  
[http://194.170.242.235/golf/golf2.gz.zip](http://194.170.242.235/golf/golf2.gz.zip)

. Here is the code so far:

zoomin.onRelease = function () {  
tellTarget(“a”)  
{  
nextFrame();  
}  
}

zoomout.onRelease = function () {  
tellTarget(“a”)  
{  
prevFrame();  
}  
}  
up.onRelease = function () {  
a.\_y = a.\_y + 10;  
}

down.onRelease = function () {  
a.\_y = a.\_y - 10;  
}

left.onRelease = function () {  
a.\_x = a.\_x + 10;  
}  
right.onRelease = function () {  
a.\_x = a.\_x - 10;  
}
