你如何触发闪光的JavaScript函数? [英] How do you trigger javascript functions from flash?

查看:167
本文介绍了你如何触发闪光的JavaScript函数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你如何触发闪光灯使用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

推荐答案

看看的<一个href="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/external/ExternalInterface.html">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...

这篇关于你如何触发闪光的JavaScript函数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆