Trying to create a rotating knob i found this script and modified it for AS3 but I'm missing something easy.

Code:
onClipEvent (onEnterFrame){
if (this.ok) {
var xVar = _root._xmouse-this._x;
var yVar = _root._ymouse-this._y;
this._r = 180-(Math.atan2((xVar), (yVar))*(180/Math.PI));
this._rotation = this._r;
trace(this._r);
}
updateAfterEvent();
}

onClipEvent (onMouseDown){
if (this.hitTest(_root._xmouse, _root._ymouse, 1))
this.ok = true;
}
onClipEvent (onMouseUp){
this.ok = false;
}
i recive this error
Code:
1087: Syntax error: extra characters found after end of program.
any ideas?
thank you in advance for your help