JS控制flash的播放
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh-CN" xml:lang="zh-CN">
<head><title>用js代码控制flash的播放</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css" media="screen">
html, body { height:100%; background-color:#5E4A09;}
body { margin:0; padding:0; overflow:hidden; }
</style>
</head>
<body>
<input type="button" value="播放" onclick="myflash.Play()"/><!-- flash会从暂停的那一帧开始播放-->
<input type="button" value="暂停" onclick="myflash.StopPlay()"/><!-- flash暂停在当前帧-->
<input type="button" value="停止" onclick="StopPlay()"/>
<input type="button" value="播放状态" onclick="alert(myflash.IsPlaying())"/><!--flash 的播放状态 true || false-->
<br/>进度控制:
<input type="button" value="返回首帧" onclick="myflash.Rewind()"/><!-- flash暂停在当前帧-->
<input type="button" value="前进" onclick="goForward()"/>
<input type="button" value="后退" onclick="backOff()"/>
<input type="button" value="当前帧" onclick="alert(myflash.CurrentFrame())"/><!--从0开始-->
<input type="button" value="总帧数" onclick="alert(myflash.TotalFrames())"/><!--返回总帧数-->
<br/>其它控制:
<input type="button" value="已加载" onclick="alert(myflash.PercentLoaded()+'%')"/>
<embed style="display:block;"
type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" src="test.swf" id="_AdSame_Flash650"
name="_AdSame_Flash650" allowscriptaccess="always" quality="high" width="1000" height="300" swliveconnect="false" wmode="opaque" flashvars="name=pmx&age=44">
<script>
var myflash = document.getElementById('_AdSame_Flash650');
function StopPlay(){
myflash.GotoFrame(0);//flash调到第一帧并停止播放
}
function goForward(){
myflash.GotoFrame(myflash.CurrentFrame()+10);//flash跳转到当前帧+10帧,并停在该帧
}
function backOff(){
myflash.GotoFrame(myflash.CurrentFrame()- 10);
}
</script>
</body>
</html>
JS控制flash的播放的更多相关文章
- JS控制flash的方法
JS控制flash的一些方法:Play() ---------------------------------------- 播放动画 StopPlay()---------------------- ...
- JS控制音频顺序播放
做一项目,用到“叫号功能”,网页上有一“叫号”按钮,点击后就读数据库中存的号码,如123号, 然后就发声音出来, 思路是网上下载0123456789的叫号声音,然后按钮点击事件里就在JS里写用那个HT ...
- JS控制视频的播放
在用js定时器控制视频时, html部分: <video id="video_1"> <source id="source_1" src=&q ...
- js控制swf播放
<html> <head> <title>用js代码控制flash的播放</title> <meta charset="utf-8&qu ...
- JS实现控制HTML5背景音乐播放暂停
首先在网页中嵌入背景音乐,html5代码为: <script src="http://wuover.qiniudn.com/jquery.js"></script ...
- 31.JS实现控制HTML5背景音乐播放暂停
实现控制网站背景音乐的播放暂停在html5中是非常容易和简单的,仅仅几行代码即可实现.首先在网页中嵌入背景音乐,html5代码为: <script src="http://wuover ...
- 自定义css样式结合js控制audio做音乐播放器
最近工作需求需要播放预览一些音乐资源,所以自己写了个控制audio的音乐播放器. 实现的原理主要是通过js调整audio的对象属性及对象方法来进行控制: 1.通过play().pause()来控制音乐 ...
- Js与flash交互:在html页面中用js与MyReport插件交互
Html页面与flash的加载 如下图,flash是html页面的一个插件节点. js与flash进行交互,首先要处理好html页面和swf的加载问题. Swf调用外部js方法,要确保js方法已存在, ...
- js控制Bootstrap 模态框(Modal)插件
js控制Bootstrap 模态框(Modal)插件 http://www.cnblogs.com/zzjeny/p/5564400.html
随机推荐
- BestCoder Round #72
由于第一次打,只能在div2打.(这么好的机会还没AK真是丢人) T1 Clarke and chemistry 枚举题不解释(我不会告诉你我上来WA了四发的) T2 Clarke and point ...
- 【Linux】linux常用基本命令(转)
(转自:http://blog.csdn.net/xiaoguaihai/article/details/8705992) Linux中许多常用命令是必须掌握的,这里将我学linux入门时学的一些常用 ...
- PHP 实现 一致性哈希 算法(转的)
<?php /** * Flexihash - A simple consistent hashing implementation for PHP. * * The MIT License * ...
- SQL 标量函数-----日期函数datediff()、 day() 、month()、year()
select day(createtime) from life_unite_product --取时间字段的天值 select month(createtime) from life_uni ...
- fetch API
一.什么是fetch? fetch的作用类似于XMLHttpRequet的作用,用于异步请求网络,其提供的API更加的完善. fetch提供了Request和Response对象的定义,用于自定义网络 ...
- 设置TOMCAT的JVM虚拟机内存大小
你知道如何设置TOMCAT的JVM虚拟机内存大小吗,这里和大家分享一下,JAVA程序启动时JVM都会分配一个初始内存和最大内存给这个应用程序.这个初始内存和最大内存在一定程度都会影响程序的性能. 设置 ...
- freemarker 图片输出、多张图片输出(图片重复原因及解决)
单张图片显示: 先写好word格式的文档,在其中插入一张图片,然后重命名为ftl,再用编辑器打开,把图片那一段base64信息用freemarker表达式替换掉. 之后把图片的信息输出到模板即可. 多 ...
- mac mysql环境配置
安装mysql:http://www.mysql.com/downloads/ 找到 MySQL Community Edition (GPL) Community (GPL) Downloads » ...
- [转自51CTO]ITIL与ISO20000的关系
ITIL它不是一个服务管理标准,而更应该说是一种结构化的方法或流程框架.基于这种方法和框架,已经有越来越多的IT服务管理标准被开发出来了.在这些基于ITIL的IT服务管理标准中,最突出的要属英国标准B ...
- HDU 1043 & POJ 1077 Eight(康托展开+BFS+预处理)
Eight Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 30176 Accepted: 13119 Special ...