I find myself still failing to understand why when using HTML5 the Mouse_Down event fires twice when someone presses on a touchscreen. I reported this behaviour as a bug in openFL months ago, it was fixed/went away, but returned in more recent versions, so i can only assume it it me that is failing to understand how Mouse_Down events should be handled properly on touchscreen devices, and devices with both touchscreens and pointers. Any help or insightful comments would be greatly appreciated.
At a basic level, here is a simple project main.hx - it creates some text, which shows how many Mouse_Down events have occured. Please could someone help my understanding of why it jumps in 2’s on touchscreens, rather than 1’s on desktop browsers !?
package;
import flash.display.Sprite;
import flash.text.TextField;
import flash.events.MouseEvent;
import flash.Lib;
class Main extends Sprite {
var textField:TextField;
var count:Int = 0;
public function new () {
super ();
textField = new TextField ();
textField.x = 50;
textField.y = 50;
textField.width = 300;
textField.text = " Mouse_Down count = ";
addChild (textField);
Lib.current.stage.addEventListener(MouseEvent.MOUSE_DOWN, onMouseDown);
}
function onMouseDown(e:MouseEvent) {
count ++;
textField.text = " Mouse_Down count = " + Std.string(count);
}
}