# Constrain movieClip

**URL:** <https://forum.kirupa.com/t/constrain-movieclip/123397>\
**Category:** Uncategorized\
**Created:** [September 23, 2004, 7:17am UTC](https://forum.kirupa.com/t/constrain-movieclip/123397 "2004-09-23T07:17:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![da\_hammer](https://avatars.discourse-cdn.com/v4/letter/d/848f3c/32.png) [@da\_hammer](https://forum.kirupa.com/u/da_hammer)\
**Post date:** [September 23, 2004, 7:17am UTC](https://forum.kirupa.com/t/constrain-movieclip/123397/1 "2004-09-23T07:17:53Z")

</div>

Hi,

i have a [color=blue]_movieClip_[/color] instance named as **[color=blue]guy[/color]** in the stage, which can only be navigated by using up,right,left and down arrow keys. I’ve written the code for navigation on the instance of the \*\*[color=blue]guy[/color] \*\*itself. (i.e onClipEvent(enterframe){

Now there are 6 **[color=blue]squares[/color]** with each of them having their own unique instance names scattered in the stage.

what right now i have written on the **[color=blue]squares[/color]** is when hit test with the [color=blue] **guy** [/color] is true, get the **[color=blue]guy[/color]** get killed

Instead of killing what i need is, i need to stop the \*\*[color=blue]guy [/color]\*\*whenever he bumps on any of the [color=blue]\*\*squares \*\*[/color][color=black]placed on the stage. [/color]

how i can constrain the guy’s \_x, \_y positions with reference to the 6 **[color=blue]squares ?[/color]**  
**[color=#0000ff][/color]**  
\*_[color=red]i’ve attached the small size .fla file as zip for your reference.[/color]_  
**[color=#0000ff][/color]**  
_[color=navy]please someone clarify me ! thanks ![/color]_  
**[color=#0000ff][/color]**  
_**[color=black]da\_hammer[/color]**_
