开发者

call a javascript from a flash? [duplicate]

开发者 https://www.devze.com 2022-12-09 16:43 出处:网络
This question already has answers here: Closed 13 years ago. Possible Duplicate: How do you trigger javascript functions from flash?
This question already has answers here: Closed 13 years ago.

Possible Duplicate:

How do you trigger javascript functions from flash?

Possible Duplicate: How do you trigger javascript functions from flash?

Can flash call a javascript?

For example a Button in a flash will call a function ($("div.boxcl开发者_JAVA百科ose").addClass("boxopen").show("slow");) from jQuery library.

Is that possible?

Thanks!


If you are using AS3, ExternalInterface.call is what you want.

In the script tag in the html page:

function theJSMethod()
{
    $("div.boxclose").addClass("boxopen").show("slow");
}

In flash:

ExternalInterface.call("theJSMethod");

If you are using AS2, you can use fscommand to achieve this.

Make sure allowScriptDomain in the embedding html code is set appropriately.


External Interface will help you :)

http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/external/ExternalInterface.html


Please take a look at this SO question: How do you trigger javascript functions from flash?

0

精彩评论

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