Moving things around when resizing a window

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:

		
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