你如何触发闪光的JavaScript函数?闪光、函数、JavaScript

2023-09-08 11:03:17 作者:一个人的烛光晚餐

你如何触发闪光灯使用ActionScript的JavaScript函数?

How do you trigger a javascript function using actionscript in flash?

我们的目标是触发从flash动画jQuery的功能

The goal is to trigger jQuery functionality from a flash movie

推荐答案

看看的ExternalInterface-Class. 从AS3语言参考:

Take a look at the ExternalInterface-Class. From the AS3-Language Reference:

ExternalInterface类是   外部API,应用程序   编程接口,使   之间实现直接通信   ActionScript和Flash播放器   盛载例如,HTML页   使用JavaScript。 Adobe建议   使用ExternalInterface的所有   JavaScript的动作通讯。

The ExternalInterface class is the External API, an application programming interface that enables straightforward communication between ActionScript and the Flash Player container– for example, an HTML page with JavaScript. Adobe recommends using ExternalInterface for all JavaScript-ActionScript communication.

和它的工作是这样的:

ExternalInterface.addCallback("sendToActionScript", receivedFromJavaScript);
ExternalInterface.call("sendToJavaScript", input.text);

您可以提交参数及免费获赠回调... pretty的酷,不是吗? ;)

You can submit parameters and recieve callbacks...pretty cool, right? ;)

据我所知这也将在AS2 ...

As I know it will also work on AS2...