Reputation: 301
I have something like this:
<object id="myflash"></object>
I've tried making jQuery click the object like so:
$('#myflash').click();
But this doesn't work. Is there another way to do this?
Upvotes: 1
Views: 1708
Reputation: 34690
Do you want to focus it, or actually click on a certain point?
You can probably use .focus()
instead of .click()
to focus the flash object. If you need to click on a certain spot, you should create a method in ActionScript that does what you want the click to do, and then call it. Your ActionScript will look something like this:
import flash.external.ExternalInterface;
ExternalInterface.addCallback("sendTextToFlash", getTextFromJavaScript);
function getTextFromJavaScript(str):void {
trace(str);
}
You then call the method with the name set in the addCallback
call directly on the object:
flashObject.sendTextToFlash('My string');
See this page for more info and a method that will get the object or embed so that it works correctly in all browsers.
Upvotes: 1