# Help a beginner having trouble with my If else statements

**URL:** <https://forum.kirupa.com/t/help-a-beginner-having-trouble-with-my-if-else-statements/292079>\
**Category:** flash\
**Created:** [July 9, 2009, 6:40pm UTC](https://forum.kirupa.com/t/help-a-beginner-having-trouble-with-my-if-else-statements/292079 "2009-07-09T18:40:59Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ACKtion](https://avatars.discourse-cdn.com/v4/letter/a/edb3f5/32.png) [@ACKtion](https://forum.kirupa.com/u/ACKtion)\
**Post date:** [July 9, 2009, 6:40pm UTC](https://forum.kirupa.com/t/help-a-beginner-having-trouble-with-my-if-else-statements/292079/1 "2009-07-09T18:40:59Z")

</div>

scrollUp\_mc and scrollDown\_mc are acting as buttons that control scroll\_mc and bar\_mc.  
The code works fine, but I need them to stop working if scoll\_mc.y is less than 136 or more than 2,189. any suggestions?

scrollUp\_mc.addEventListener(MouseEvent.CLICK, goUp);  
scrollDown\_mc.addEventListener(MouseEvent.CLICK, goDown);

function goUp(evtObj:MouseEvent):void{  
scroll\_mc.y -=325;  
bar\_mc.y+=32;  
}  
function goDown(evtObj:MouseEvent):void{  
scroll\_mc.y +=325;  
bar\_mc.y-=32;  
}
