Simulate a mouse click in Flash using JavaScript
Background: I'm developing Greasemonkey scripts for a website. I do not control the Flash 开发者_Go百科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?
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)
精彩评论