You should be able to replace the onClipEvent lines with these:

PHP Code:
onMouseDown = function():Void{

// ...

onEnterFrame = function():Void