Mouse trail

hey everybody. im trying to make a mouse trail thingy for my website and wat im tryin to do is there’s gonna be a bomb and whenever someone clicks on a hyperlink there’s an explosion, but i cant seem to get the code to work. the original code works but when i added the MovieClip.onMouseDown i stopped working.
here’s the code:

onClipEvent (load) {
_x = 0;
_y = 0;
speed = 5;
}
onClipEvent (enterFrame) {
endX = _root._xmouse;
endY = _root._ymouse;
_x += (endX-_x)/speed;
_y += (endY-_y)/speed;
}
onClipEvent (enterFrame) {
MovieClip.onMouseDown = function() {
gotoAndStop(2);
}
}

[AS]onClipEvent (enterFrame) {
MovieClip.onMouseDown = function() {
gotoAndStop(2);
}
}[/AS]

There are a few things wrong with that section.

  1. You should never have to of the same onClipEvent handlers on 1 clip, you can put it all inside the one and it will work.

  2. MovieClip is an object, what you need there would be an instance name so that the code knows which clip to target. Aside from that, you don’t need to run it on enterFrame, and you don’t really need to run it at all in this case :slight_smile:

What I recommend doing is on the buttons that you can press add (within the on(press) handler or whatever you are using on it) [AS]clipThatFollowsMouseInstanceName.gotoAndStop(2);[/AS]