# mouseX problem when width changed

**URL:** <https://forum.kirupa.com/t/mousex-problem-when-width-changed/324079>\
**Category:** flash\
**Created:** [August 1, 2011, 1:15pm UTC](https://forum.kirupa.com/t/mousex-problem-when-width-changed/324079 "2011-08-01T13:15:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![palmjack](https://avatars.discourse-cdn.com/v4/letter/p/85f322/32.png) [@palmjack](https://forum.kirupa.com/u/palmjack)\
**Post date:** [August 1, 2011, 1:15pm UTC](https://forum.kirupa.com/t/mousex-problem-when-width-changed/324079/1 "2011-08-01T13:15:11Z")

</div>

Not sure if I’m missing sth or is it just a bug.

I have a movieclip on stage, it’s a simple rectangle drawn with a rect tool (no stroke)

I add an event listener to trace out the mouseX, works OK so far.  
When I increase its width the mouseX traces wrong values.

Here’s a sample code:

```auto

stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;

stage.addEventListener(Event.RESIZE, stageResize);

function stageResize(e:Event):void
{
    rect.width = stage.stageWidth - 50;
}

rect.addEventListener(MouseEvent.CLICK, rectClick);

function rectClick(e:MouseEvent):void
{
    trace(rect.mouseX);
    trace(rect.width);
}

```

So when the stage is resized, rect.mouseX gives me the values like the rect was never resized.
