# "Stage.onResize" Question...very irritating..Scotty?

**URL:** <https://forum.kirupa.com/t/stage-onresize-question-very-irritating-scotty/187481>\
**Category:** Uncategorized\
**Created:** [April 29, 2006, 5:20pm UTC](https://forum.kirupa.com/t/stage-onresize-question-very-irritating-scotty/187481 "2006-04-29T17:20:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![5TEF](https://avatars.discourse-cdn.com/v4/letter/5/85e7bf/32.png) [@5TEF](https://forum.kirupa.com/u/5TEF)\
**Post date:** [April 29, 2006, 5:20pm UTC](https://forum.kirupa.com/t/stage-onresize-question-very-irritating-scotty/187481/1 "2006-04-29T17:20:13Z")

</div>

hi,

i’m currently making my new personnal website.  
it’s a fullscreen website.

i’ve got a curious and very irritating problem :  
so, i’ve got several elements ( buttons ) on my scene.

when i press on the “button 1” , this “button 1” must move on \_y ( -50 ) ( using a tween class ) : ok, it work fine.

but when i resize my window brownser, my button 1 must move in consequence to stay at the same position before the “onPress”…  
so, with the help of “stageListener.onResize = function() {…” and a listener, the button 1 move, BUT THE NEW \_Y VALUE IS NOT THE SAME !!!

i don’t understand the pb, because with other elements, all work fine…

when i press the button, this is my AS code :

```auto

btn1.onPress = function() {
this.tween(["_y"], [Stage.height-this._height-50], 1, "easeOutExpo");}

```

when resizing my windows:

```auto

stageListener.onResize = function() {
btn1.tween(["_y"], [Stage.height-btn1._height-50], 1 "easeOutExpo");}

```

the result, after resizing my firefox window : i’ve got a 8pix difference !

so, i must put this code instead:

```auto

stageListener.onResize = function() {
btn1.tween(["_y"], [Stage.height-btn1._height- **58**], 1 "easeOutExpo");}

```

it’s not logical !!! why this problem ???
