# How can I make this work with a centeral regestration

**URL:** <https://forum.kirupa.com/t/how-can-i-make-this-work-with-a-centeral-regestration/299504>\
**Category:** Uncategorized\
**Created:** [November 5, 2009, 9:39pm UTC](https://forum.kirupa.com/t/how-can-i-make-this-work-with-a-centeral-regestration/299504 "2009-11-05T21:39:29Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Daimz](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/daimz/32/2383_2.png) [@Daimz](https://forum.kirupa.com/u/Daimz)\
**Post date:** [November 5, 2009, 9:39pm UTC](https://forum.kirupa.com/t/how-can-i-make-this-work-with-a-centeral-regestration/299504/1 "2009-11-05T21:39:29Z")

</div>

how can I make this script work from the center of the movie clip not the top left? Basicly its a slider but it is giving me some greif because A) i need it to start in the middle and B) its chopping part of the movie clip off when the stage is resized(another movie loads the scroller in and that movie is a fluid style layout) so I think just centering it would work as needed and I dont have much time my assignment due in 1.5 days and I need to reg his working nicely.

any ideas?

```auto
var tl:MovieClip=this;

 

paramF(mc,0,0,stage.stageWidth,stage.stageWidth-mc.width);

 

tl.addEventListener(Event.ENTER_FRAME,scrollF);

 

function scrollF(e:Event){

mc.x=mc.m*tl.mouseX+mc.b;

}

 

function paramF(mc:MovieClip,x1:Number,y1:Number,x2:Number,y2:Number){

mc.m=(y1-y2)/(x1-x2);

mc.b=y1-mc.m*x1;

}

```
