Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Simulate a mouse click in Flash using JavaScript

Background: I'm developing Greasemonkey scripts for a website. I do not control the Flash file.

Question: Is it possible to simulate a mouse click on a button/movie clip in a Flash object embedded in a web page? Googling only shows ways to simulate a mouse click on a DOM element, and ways that require the ActionScript to be changed to implement a JavaScript interface. Or is this simply impossible?

like image 805
Hello71 Avatar asked Jun 27 '10 16:06

Hello71


1 Answers

It's not possible unless the SWF implements ExternalInterfaces and opens up a function to be called from Javascript to allow it access to the _root. Even then, the SWF has to have methods inside it to allow calling onclick events. The best you can do is clicking on the object element because Javascript doesn't have a method for simulating a click at a specific (x, y)

like image 72
Andir Avatar answered Sep 27 '22 22:09

Andir