# AS2 - Mouse DoubleClick

**URL:** <https://forum.kirupa.com/t/as2-mouse-doubleclick/65656>\
**Category:** flash\
**Created:** [September 28, 2004, 3:31pm UTC](https://forum.kirupa.com/t/as2-mouse-doubleclick/65656 "2004-09-28T15:31:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mojave3](https://avatars.discourse-cdn.com/v4/letter/m/e480ec/32.png) [@mojave3](https://forum.kirupa.com/u/mojave3)\
**Post date:** [September 28, 2004, 3:31pm UTC](https://forum.kirupa.com/t/as2-mouse-doubleclick/65656/1 "2004-09-28T15:31:57Z")

</div>

Hey Guys,

the script below is scripted in AS1 and I want to change it into AS2.  
the script checks if the mouse is doubleclicked.  
I know in AS2 i have to get away of the prototype stuff but in this case im pretty dumb to it.  
so is there anybody who can help me?

thnx.  
mojave

Mouse.onMouseDown = function() {  
if (this.last\_click == undefined) {  
this.last\_click = 300;  
}  
if (getTimer()-this.last\_click\<300) {  
this.broadcastMessage("$onDoubleClick");  
}  
this.last\_click = getTimer();  
};  
Mouse.addListener(Mouse);  
MovieClip.prototype.addProperty(“onDoubleClick”, function () {  
return this.$onDoubleClick;  
}, function (f) {  
this.$onDoubleClick = f;  
Mouse.addListener(this);  
});  
this.onDoubleClick = function() {  
trace(“DoubleClick!”);  
};
