# Can't move

**URL:** <https://forum.kirupa.com/t/cant-move/181453>\
**Category:** Uncategorized\
**Created:** [March 9, 2006, 2:30pm UTC](https://forum.kirupa.com/t/cant-move/181453 "2006-03-09T14:30:24Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![shulhi](https://avatars.discourse-cdn.com/v4/letter/s/97f17d/32.png) [@shulhi](https://forum.kirupa.com/u/shulhi)\
**Post date:** [March 9, 2006, 2:30pm UTC](https://forum.kirupa.com/t/cant-move/181453/1 "2006-03-09T14:30:24Z")

</div>

i’m having a problem right now cause i’m not so good in AS…just a newbie. this is my problem. i create movieclip (i named it mcContainer), then inside the mcContainer, i made another two movieclip - mcPath and mcHero. the mcPath function as a path while the mcHero is the one that i want it to be move by player using keyboard…mcHero can be moved but i want it to move only inside the mcPath areas. i’m trying to make a maze game right now…anyone could help with my probs??? for now this is the AS i use in mcHero

```auto
onClipEvent (enterFrame) {
if (Key.isDown (Key.RIGHT)) {
gotoAndStop("right");
this._x += 6; 
}
if (Key.isDown (Key.LEFT)) {
gotoAndStop("left");
this._x -= 6; 
}
if (Key.isDown (Key.DOWN)) {
gotoAndStop("down");
this._y += 6;
}
if (Key.isDown (Key.UP)) {
gotoAndStop("up");
this._y -= 6; 
}
if(!this.hitTest(_root.mcContainer.mcPath._x,_root.mcContainer.mcPath._y,true)){
    
    _x = oldx;
    _y = oldy;
}
oldx = _x;
oldy = _y;
} 

```
