# Full window and onResize question

**URL:** <https://forum.kirupa.com/t/full-window-and-onresize-question/250914>\
**Category:** flash\
**Created:** [February 3, 2008, 10:34am UTC](https://forum.kirupa.com/t/full-window-and-onresize-question/250914 "2008-02-03T10:34:23Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![manny2k](https://avatars.discourse-cdn.com/v4/letter/m/49beb7/32.png) [@manny2k](https://forum.kirupa.com/u/manny2k)\
**Post date:** [February 3, 2008, 10:34am UTC](https://forum.kirupa.com/t/full-window-and-onresize-question/250914/1 "2008-02-03T10:34:23Z")

</div>

[FONT=Times New Roman][SIZE=3]Hi[/SIZE][/FONT]

[FONT=Times New Roman][SIZE=3]Been trying to work this one out for ages, I’ve a MC on stage named container\_mc and 4 buttons in globalNav\_mc, which move the container\_mc to 4 different coordinates, everything is ok and works fine, the problem I have is I cant get the onResize listener to reposition the container\_mc to whatever position is at when the window is resized.[/SIZE][/FONT]

[FONT=Times New Roman][SIZE=3]Ive tried a few if statement in the listener function but with no luck[/SIZE][/FONT]

[FONT=Times New Roman][SIZE=3]Example :[/SIZE][/FONT]

```php
 
If(container_mc._y ==Stage.width/2-230){
Container_mc.slideTo(Stage.width/2-230,Stage.height/2+230,1,”easeOutExpo”);
}

```

[SIZE=3][FONT=Times New Roman] Any help would be greatly appreciated [/FONT][/SIZE]

```php
 
var myListener:Object ();
myListener.onResize = function {
globalNav_mc.tween(“_y”,Stage.height/2-230,1,”easeOutExpo”)
globalNav_mc.tween(“_x”,Stage.width/2-350,1,”easeOutExpo”)
}
Stage.addListener(myListener);
myListener.onResize();
 
///// button code and coordinates///
GlobalNav_mc.move1_btn.onRelease = function(){
Container_mc.slideTo(Stage.width/2-230,Stage.height/2+230,1,”easeOutExpo”);
}
GlobalNav_mc.move2_btn.onRelease = function(){
Container_mc.slideTo(Stage.width/2-130,Stage.height/2+110,1,”easeOutExpo”);
}
GlobalNav_mc.move3_btn.onRelease = function(){
Container_mc.slideTo(Stage.width/2-200,Stage.height/2+200,1,”easeOutExpo”);
}
GlobalNav_mc.move4_btn.onRelease = function(){
Container_mc.slideTo(Stage.width/2-180,Stage.height/2+40,1,”easeOutExpo”);
}
//// initial positions///
globalNav_mc._y = Stage.height/2-230;
globalNav_mc._x = Stage.width/2-350;
container_mc._y = Stage.height/2;
container_mc._x = Stage.width/2;

```
