Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Simulate click event in AS3

Is there any way to simulate a click event in AS3? I'm trying this:

element.dispatchEvent(new MouseEvent(MouseEvent.MOUSE_DOWN, true, false));

But click event isn't trigger it.

like image 730
Fran Verona Avatar asked Sep 23 '11 10:09

Fran Verona


1 Answers

If you are listening for MouseEvent.CLICK then dispatch MouseEvent.CLICK. You are now dispatching MouseEvent.MOUSE_DOWN

element.dispatchEvent(new MouseEvent(MouseEvent.CLICK));
like image 150
Pranav Hosangadi Avatar answered Oct 29 '22 17:10

Pranav Hosangadi