Mausverfolgung mit JavaScript Funktion

slimox

Mitglied
Hallo,

Auf einem MC habe ich diese Aktion:
Code:
onClipEvent (enterFrame) {
        myRadians = Math.atan2(_root._ymouse-this._y, _root._xmouse-this._x);
        myDegrees = Math.round((myRadians*180/Math.PI));
        _root.yChange = Math.round(_root._ymouse-this._y);
        _root.xChange = Math.round(_root._xmouse-this._x);
        _root.yMove = Math.round(_root.yChange/20);
        _root.xMove = Math.round(_root.xChange/20);
		if(_root._xmouse >= 0 && _root._xmouse <= 960 && _root._ymouse >= 0 && _root._ymouse <= 140) {
			this._x += _root.xMove;
			this._y += _root.yMove;
			this._rotation = myDegrees+90;
		}
}

Wie kann ich machen, dass beim rollover (auf den MC) eine Javascript funktion ausgeführt wird? :D

Für alle Ideen Dankbar!
 
Zurück