# MovieClip collision

**URL:** <https://forum.kirupa.com/t/movieclip-collision/265773>\
**Category:** flash\
**Created:** [July 12, 2008, 8:50am UTC](https://forum.kirupa.com/t/movieclip-collision/265773 "2008-07-12T08:50:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![shadowkeeper](https://avatars.discourse-cdn.com/v4/letter/s/6bbea6/32.png) [@shadowkeeper](https://forum.kirupa.com/u/shadowkeeper)\
**Post date:** [July 12, 2008, 8:50am UTC](https://forum.kirupa.com/t/movieclip-collision/265773/1 "2008-07-12T08:50:17Z")

</div>

hi all

```
    im not able to understand how to stop the movie clip when it hits 
    the particular object
    
     i have two movie clips one is the circle and the other is the human
     wen ever the circle collides the human it should be stopped and after
     a few sec it should again move in the same direction
     here is wat i wrote but dnt know how to write the code for stopping the movie clip plzz anyone help me here is wat i got

```

```auto

// this is wat i wrote on the circle moviclip
onClipEvent (enterFrame) {
     if(_root.circle.hitTest(_root.human)) {    
        _root.text="collision ";
     }
     else{
         _root.text="nothing ";
     }
    }

```

and on the main scene

```auto
_root.circle._x = 150;
_root.circle._y = 150;
var speed = 2;
if (_root.circle._x == 150 && _root.circle._y == 150) {
    angle = random(360);
    angle = angle*3.141593E+000/180;
    trace("angle "+angle);
    _root.circle.xmov = speed*Math.cos(angle);
    _root.circle.ymov = speed*Math.sin(angle);
    _root.circle.onEnterFrame = function() {
        this._x = this._x+this.xmov;
        this._y = this._y+this.ymov;
    };
}

```
