# Odd movement inside MovieClip

**URL:** <https://forum.kirupa.com/t/odd-movement-inside-movieclip/312329>\
**Category:** flash\
**Created:** [July 30, 2010, 7:50pm UTC](https://forum.kirupa.com/t/odd-movement-inside-movieclip/312329 "2010-07-30T19:50:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![aszex](https://avatars.discourse-cdn.com/v4/letter/a/90ced4/32.png) [@aszex](https://forum.kirupa.com/u/aszex)\
**Post date:** [July 30, 2010, 7:50pm UTC](https://forum.kirupa.com/t/odd-movement-inside-movieclip/312329/1 "2010-07-30T19:50:16Z")

</div>

I have problem, it may be stupid, but i have no idea how to solve it. Furthermore I don’t even know what causes it.

I have a MovieClip “world” on my main stage, it contains level and player. I use standart (?) code for moving my player

if (Key.isDown(Key.LEFT) || Key.isDown(65))  
{  
\_x -= speed;  
}  
etc

and this code to check the collision with level walls

while (\_parent.walls.hitTest(\_x, \_y+radius, true))  
{  
\_y–;  
}  
while (\_parent.walls.hitTest(\_x, \_y-radius, true))  
{  
\_y++;  
}  
while (\_parent.walls.hitTest(\_x-radius, \_y, true))  
{  
\_x++;  
}  
while (\_parent.walls.hitTest(\_x+radius, \_y, true))  
{  
\_x–;  
}

Where radius is Math.max(\_width,\_height)/2+1;

What is the problem : when I move my “world” movieclip (containing all other MCs) there is a problem with collision detection. The picture of the walls moves correctly, but the collision is detected like if it was moved further.

I deleted all actionscript, leaving only moving and collision detection and i really don’t know what is going on.

You can see what I mean in attachment (space to move the container MC)
