# Function problem

**URL:** https://forum.kirupa.com/t/function-problem/153008
**Category:** Uncategorized
**Created:** [June 28, 2005, 6:26pm UTC](https://forum.kirupa.com/t/function-problem/153008 "2005-06-28T18:26:49Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Thinker2501](https://avatars.discourse-cdn.com/v4/letter/t/e0b2c6/32.png) [@Thinker2501](https://forum.kirupa.com/u/Thinker2501)
#### Post date: [June 28, 2005, 6:26pm UTC](https://forum.kirupa.com/t/function-problem/153008/1 "2005-06-28T18:26:49Z")

</div>

Whenever a movie clip envokes the following code it moves the whole stage, what gives?

function center (stageW, stageH) {  
this.centerStageX = Math.floor(stageW/2);  
this.centerStageY = Math.floor(stageH/2);  
this.speedX = (this.centerStageX-this.\_x)/4;  
this.speedY = (this.centerStageY-this.\_y)/4;  
this.\_x += this.speedX;  
this.\_y += this.speedY;  
}

I would appriciate it if whoever fixes this could also explain why this is happening so I know for the future, thank you all for you help.
