Mouse mirroring

Code Actionscript 2.0

Instance action

// always put cursor2 opposed to mouse position
onClipEvent (enterFrame) {
this._x = 400 - _root._xmouse;
this._y = _root._ymouse;

Instance action

onClipEvent (load) {
startDrag(this, true);

Code Actionscript 3.0

cursor2.addEventListener(Event.ENTER_FRAME, enterFrame); maincursor.startDrag(true); Mouse.hide(); function enterFrame(event:Event) { cursor2.x = 400 - mouseX; cursor2.y = mouseY; }


The cursor is mirrored on the horizontal axis. Two instances of maincursor and cursor2 are necessary for this to take place. The function startDrag causes the maincursor to follow the (invisible) mouse. The mirrored position of cursor2 is calculated by following the position of maincursor.


Right click: Flashfile AS 2.0 | Flashfile AS 3.0 | SWF-File