so I needed to record a double click in flash for a project and went looking for code.
wow. there's a lot of convoluted and LONG code out there for such a simple thing! recording a double click shouldn't require 30 lines of code. if it does, you're doing something seriously wrong.
here's MY actionscript 2 (AS2) code for detecting a double click in flash if you want to change the speed at which you want to detect make 'double_click_wait' higher or lower. 11 lines of code is all you should need.
//mouse double click
var double_click_wait = 300;
var lastClick = 0;
var mouseListener:Object = new Object();
mouseListener.onMouseUp = function() {
if ((getTimer()-previousClick) < double_click_wait) {
trace("mouse double click ");
previousClick = 0;
}
previousClick = getTimer();
};
Mouse.addListener(mouseListener);
(126) Total entries in journal
// Finland 2003
"That was when I realized. I asked myself could some of what these people be talking about actually be dangerous? And the best thing I can do is stay close to them, track what they are interested in and either hack it or try to confuse the spaces in which they operate". - Rob Van Kranenburg