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
// 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
_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;
};
}