开发者

Simulate a mouse click in Flash using JavaScript

开发者 https://www.devze.com 2023-01-05 08:40 出处:网络
Background: I\'m developing Greasemonkey scripts for a website. I do not control the Flash 开发者_Go百科file.

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)

0

精彩评论

暂无评论...
验证码 换一张
取 消