使用 JavaScript 控制 Flash Player [英] Controlling a Flash Player using JavaScript

查看:35
本文介绍了使用 JavaScript 控制 Flash Player的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望能够在与 Flash 组件相同的页面中使用 JavaScript 控制 Flash 电影流,包括:

I would like to be able to control a flash movie stream using JavaScript in the same pages as the flash component including:

  • 播放和暂停流
  • 改变流

我已经可以加载播放器并设置 flash 参数,但是我不知道在流开始后如何与播放器交互.这是否可以不修改当前用于播放电影的 SWF?

I can already load the player and set the flash args, but I don't know how to interact with the player once the stream has started. Is this possible without modifying the SWF that is currently used to play the movie?

迈克.

推荐答案

SWF 需要使用 Flash 库中的 ExternalInterface API 将函数公开给 Javascript.这允许 Javascript 调用 Flash,反之亦然.

The SWF needs to expose functions to Javascript using the ExternalInterface API from the Flash libraries. This allows Javascript to call into Flash and vice-versa.

http://livedocs.adobe.com/flex/3/langref/flash/external/ExternalInterface.html

这篇关于使用 JavaScript 控制 Flash Player的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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