# Problem with Scrolling Dynamically Loaded MC on stage resize

**URL:** <https://forum.kirupa.com/t/problem-with-scrolling-dynamically-loaded-mc-on-stage-resize/253938>\
**Category:** flash\
**Created:** [March 6, 2008, 5:03pm UTC](https://forum.kirupa.com/t/problem-with-scrolling-dynamically-loaded-mc-on-stage-resize/253938 "2008-03-06T17:03:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![BhavikShah](https://avatars.discourse-cdn.com/v4/letter/b/41988e/32.png) [@BhavikShah](https://forum.kirupa.com/u/BhavikShah)\
**Post date:** [March 6, 2008, 5:03pm UTC](https://forum.kirupa.com/t/problem-with-scrolling-dynamically-loaded-mc-on-stage-resize/253938/1 "2008-03-06T17:03:20Z")

</div>

Hi Friends

I’ve a 1 image scrolling mc where images are loaded dynam icaly loaded.

I m keeping my Movie clip on ceter of the stage.

If i keep my stage size normal then it works fine but when i resize my stage then its not working proper. I’ve a following code for scrolling mc.

* * *

this.onMouseMove = function()  
{

```
mouseCheckStartX = page_collections._x;
mouseCheckEndX = mouseCheckStartX + 750;
mouseCheckStartY = page_collections._y;
mouseCheckEndY = mouseCheckStartY + 350;

```

[INDENT]if ((\_xmouse\>mouseCheckStartX && \_xmouse\<mouseCheckEndX) && (\_ymouse\>mouseCheckStartY && \_ymouse\<mouseCheckEndY))  
{  
[INDENT] ScrollingCollectionTimeLine(parentMovie, 12, 1);  
[/INDENT] }  
[/INDENT] };

function ScrollingCollectionTimeLine(target:MovieClip, speed:Number, dir:Number)  
{  
var mousePercent:Number = \_xmouse/725;  
var mSpeed:Number;  
if (dir == 1)  
{  
mSpeed = mousePercent;  
}  
else  
{  
mSpeed = 1-mousePercent;  
}  
target.destX = Math.round(-((target.\_width-425)_mSpeed));  
target.max = -(target.\_width-485);  
target.onEnterFrame = function()  
{  
if (target.\_x == target.destX)  
{  
delete target.onEnterFrame;  
}  
else  
{  
target.\_x += Math.ceil((target.destX-target.\_x)_(speed/100));  
}  
if (parentMovie.\_x\>(-350))  
{  
parentMovie.\_x = -350;  
}  
else if (parentMovie.\_x\<target.max)  
{  
parentMovie.\_x = target.max;  
}  
};  
}

* * *

Any help will be highly appreciated.

Many thx in advance
