# Moving things around when resizing a window

**URL:** https://forum.kirupa.com/t/moving-things-around-when-resizing-a-window/292455
**Category:** Uncategorized
**Created:** [July 14, 2009, 12:57pm UTC](https://forum.kirupa.com/t/moving-things-around-when-resizing-a-window/292455 "2009-07-14T12:57:16Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![docchaos](https://avatars.discourse-cdn.com/v4/letter/d/ac91a4/32.png) [@docchaos](https://forum.kirupa.com/u/docchaos)
#### Post date: [July 14, 2009, 12:57pm UTC](https://forum.kirupa.com/t/moving-things-around-when-resizing-a-window/292455/1 "2009-07-14T12:57:16Z")

</div>

Hi guys,

i have this problem where I want something (in this case a bitmap) to be positioned in the top right border of my window. But at the same time, I want to allow resizing the window and I want my bitmap to stay in the corner (i.e. move around with the border). So in my document class, I wrote an EventListener to do the job:

```auto
		
private function resizeHandler(e:Event) {
	bg_img.x = stage.stageWidth - bg_img.width;
	bg_img.y = 0;
}

```

But that doesn’t work too well: When I make the window wider, the image moves to far to the right (I think twice as fast as it should), so when I make the window wide enough, the image will eventually be outside of the window.  
On the other hand, when I make the window higher, the image moves down (I think half as fast as the bottom-border).  
Through some traces, I found out, that when I resize and don’t try to move the image, my MovieClip containing the image stays exactly the same size (even though the stage expands) and that when I try to move the image, the MovieClip gets roughly as wide as the stage. Does this have anything to do with my problem?

cheers,  
Marc
