# If? else? getProperty?

**URL:** <https://forum.kirupa.com/t/if-else-getproperty/233920>\
**Category:** Uncategorized\
**Created:** [July 28, 2007, 2:02am UTC](https://forum.kirupa.com/t/if-else-getproperty/233920 "2007-07-28T02:02:41Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![MASAKR](https://avatars.discourse-cdn.com/v4/letter/m/54ee81/32.png) [@MASAKR](https://forum.kirupa.com/u/MASAKR)\
**Post date:** [July 28, 2007, 2:02am UTC](https://forum.kirupa.com/t/if-else-getproperty/233920/1 "2007-07-28T02:02:41Z")

</div>

Hi. I am using this code to align my main mc to the stage of my flash movie.

```auto
Stage.align = "TL";
Stage.scaleMode = "noScale";
main_mc._y = Stage.height/2;
sizeListener = new Object();
sizeListener.onResize = function() {
main_mc._y = Stage.height/2;
};
Stage.addListener(sizeListener);

```

(this is for a website)  
What I want is to detect when main\_mc hits the top of the stage/browser window and make it not to go any further as the stage/browser window is made smaller. Did I get myself clear?
