# How to use if condition in a function mentioning the area?

**URL:** <https://forum.kirupa.com/t/how-to-use-if-condition-in-a-function-mentioning-the-area/325543>\
**Category:** flash\
**Created:** [October 21, 2011, 6:23pm UTC](https://forum.kirupa.com/t/how-to-use-if-condition-in-a-function-mentioning-the-area/325543 "2011-10-21T18:23:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![learner\_7n](https://avatars.discourse-cdn.com/v4/letter/l/b2d939/32.png) [@learner\_7n](https://forum.kirupa.com/u/learner_7n)\
**Post date:** [October 21, 2011, 6:23pm UTC](https://forum.kirupa.com/t/how-to-use-if-condition-in-a-function-mentioning-the-area/325543/1 "2011-10-21T18:23:43Z")

</div>

Hi,

How can I use if condition in a function?

If my mouse cursor not in the following area:  
between x:150 & x:250  
between y:50 & 350

Then the following condition to be applied:

function areaOut(e:MouseEvent):void {

TweenLite.to(ButtonsPanel2\_mc, 0,{alpha:0, x:463.8, y:-400});  
}

What is the code, Please?
