//function for calculating is click is double click or single click:
stage.addEventListener(MouseEvent.CLICK, checkDoubleClick);
var mClick:Boolean = false;
var timer;
var timer2;
//
function checkDoubleClick(e:*) {
if (! mClick) {
timer = getTimer()/1000;
mClick = true;
} else {
timer2 = getTimer()/1000;
}
//if it is a double click
if ((timer2-timer)<.20) {
trace("double click");
} else {
timer = getTimer()/1000;
trace("single click");
}
}
Friday, December 18, 2009
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment