Hi. I tried it but the cursor doesnt react at all. Here is the full code
// Variables that keep the mouse pos and if it was stopped already to avoid
doing OnMouseStop all the time
Mouse.hide();
// when the mouse doesn't move.
var xMousePos:Number = 0;
var yMousePos:Number = 0;
var bMouseIsStopped:Boolean = true;
function OnMouseStop() {
// Your code here for when the mouse stops.
_root.mainMc.crosshair_mc.butterFlyMc.gotoAndStop("stop");
}
function onEnterFrame() {
// Get the new mouse position.
var xNewMousePos:Number = _xmouse;
var yNewMousePos:Number = _ymouse;
// Check if the mouse has stopped if it wasn't stopped already.
if (!bMouseIsStopped && xNewMousePos == xMousePos && yNewMousePos ==
yMousePos) {
bMouseIsStopped = true;
OnMouseStop();
trace ();
}
// Keep the new mouse position.
xMousePos = _xNewMousePos;
yMousePos = _yNewMousePos;
}
mouseListener.onMouseMove = function() {
crosshair_mc._x = _xmouse;
crosshair_mc._y = _ymouse;
_root.mainMc.crosshair_mc.butterFlyMc.gotoAndStop("flap");
updateAfterEvent();
// The mouse isn't stopped anymore since it moved.
bMouseIsStopped = false;
};
// When you click the mouse, check to see if the cursor is within the
boundaries of the Stage. If so, increment the number of shots.
mouseListener.onMouseDown = function() {
_root.mainMc.crosshair_mc.butterFlyMc.gotoAndStop("stop");
if (this.hitTest(_xmouse, _ymouse, false)) {
_global.shots++;
}
};
Mouse.addListener(mouseListener);