需要开发一个android网页程序,在html中以js控制flash的播放、暂停等功能。写的html通过android的webView加载,在eclipse环境下测试html+js一切正常,播放、暂停、跳转到顾定帧等均可以运行。但是用IE、FF、Opera等打开html后,仅部分js功能正常(如播放,暂停等),但跳转到顾定帧等无法正常调用,请求大侠支持,具体原因是什么?求高手指点,感激不尽。我的html代码来自于互联网(http://www.iamued.com/demo/flashjs/),新增了个别功能,如下:
————————————————————————————————<HTML> <HEAD> <META content="text/html; charset=utf-8" http-equiv="Content-Type"> <TITLE>测试@20121018 JavaScript控制flash操作 By http://www.IamUED.com </TITLE><SCRIPT type="text/javascript"> function getFlashMovieObject(movieName) { if (window.document[movieName]) { return window.document[movieName]; } if (navigator.appName.indexOf("Microsoft Internet")==-1) { if (document.embeds && document.embeds[movieName]) return document.embeds[movieName]; } else // if (navigator.appName.indexOf("Microsoft Internet")!=-1) { return document.getElementById(movieName); } } function StopFlashMovie() { var flashMovie=getFlashMovieObject("Myflash"); flashMovie.StopPlay(); }function PlayFlashMovie() { var flashMovie=getFlashMovieObject("Myflash"); flashMovie.Play(); //embed.nativeProperty.anotherNativeMethod(); }function RewindFlashMovie() { var flashMovie=getFlashMovieObject("Myflash"); flashMovie.Rewind(); }function NextFrameFlashMovie() { var flashMovie=getFlashMovieObject("Myflash"); // 4 is the index of the property for _currentFrame // currentFrame=flashMovie.TGetProperty("/", 4); var currentFrame = flashMovie.CurrentFrame(); var nextFrame=parseInt(currentFrame+1); if (nextFrame>=15) nextFrame=0; flashMovie.GotoFrame(nextFrame); }function PrevFrameFlashMovie() { var flashMovie=getFlashMovieObject("Myflash"); // 4 is the index of the property for _currentFrame //var currentFrame=flashMovie.TGetProperty("/", 4); var currentFrame = flashMovie.CurrentFrame(); var prevFrame=parseInt(currentFrame-1); if (prevFrame<=0) prevFrame=0; flashMovie.GotoFrame(prevFrame); }function GotoFrameFlashMovie(frame) { var flashMovie=getFlashMovieObject("Myflash"); var frametogo=parseInt(frame); flashMovie.GotoFrame(frametogo); }function ZoominFlashMovie() { var flashMovie=getFlashMovieObject("Myflash"); flashMovie.Zoom(90); }function ZoomoutFlashMovie() { var flashMovie=getFlashMovieObject("Myflash"); flashMovie.Zoom(110); }function SendDataToFlashMovie() { var flashMovie=getFlashMovieObject("Myflash"); flashMovie.SetVariable("/:mytext", document.getElementById("data").value); }function ReceiveDataFromFlashMovie() { var flashMovie=getFlashMovieObject("Myflash"); document.getElementById("data").value=flashMovie.GetVariable("/:mytext"); //document.controller.Data.value=message; } </SCRIPT><META name="GENERATOR" content="MSHTML 9.00.8112.16450"> </HEAD><BODY> <DIV id="content"><center> <table width="" height="" cellpadding="0" cellspacing="0" border="0"> <tr> <td align="center" valign="middle"> <OBJECT id="Myflash" codeBase="http://active.macromedia.com/flash2/cabs/swflash.cab#version=4,0,0,0" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="440" height="300"><PARAM name="movie" value="test01.swf"> <PARAM name="quality" value="high"> <PARAM name="play" value="false"> <PARAM name="bgcolor" value="#FFFFFF"> <EMBED height="480" name="Myflash" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" width="900" src="test01.swf" bgcolor="#FFFFFF" quality="high" swliveconnect="true" play="false"></OBJECT><BR><BR><BR><INPUT onclick="PlayFlashMovie()" value="播放" type="button"> <INPUT onclick="StopFlashMovie()" value="暂停" type="button"> <INPUT onclick="RewindFlashMovie()" value="停止" type="button"> <INPUT onclick="NextFrameFlashMovie()" value="下一帧" type="button"> <INPUT onclick="PrevFrameFlashMovie()" value="上一帧" type="button"> <INPUT onclick="ZoominFlashMovie()" value="放大" type="button"> <INPUT onclick="ZoomoutFlashMovie()" value="缩小" type="button"> <INPUT onclick="GotoFrameFlashMovie(10)" value="第10帧" type="button"> <!INPUT onclick="SendDataToFlashMovie()" value="发送数据" type="button"> <!INPUT onclick="ReceiveDataFromFlashMovie()" value="接收数据" type="button"> <!INPUT id="data" type="text"> </DIV><SCRIPT language="JavaScript" charset="gb2312" src="files/stat.js"> </SCRIPT></td> </tr> </table> </center></SPAN> </BODY></HTML>————————————————————————————————
加载的flash资源如下:http://www.iamued.com/demo/flashjs/
————————————————————————————————<HTML> <HEAD> <META content="text/html; charset=utf-8" http-equiv="Content-Type"> <TITLE>测试@20121018 JavaScript控制flash操作 By http://www.IamUED.com </TITLE><SCRIPT type="text/javascript"> function getFlashMovieObject(movieName) { if (window.document[movieName]) { return window.document[movieName]; } if (navigator.appName.indexOf("Microsoft Internet")==-1) { if (document.embeds && document.embeds[movieName]) return document.embeds[movieName]; } else // if (navigator.appName.indexOf("Microsoft Internet")!=-1) { return document.getElementById(movieName); } } function StopFlashMovie() { var flashMovie=getFlashMovieObject("Myflash"); flashMovie.StopPlay(); }function PlayFlashMovie() { var flashMovie=getFlashMovieObject("Myflash"); flashMovie.Play(); //embed.nativeProperty.anotherNativeMethod(); }function RewindFlashMovie() { var flashMovie=getFlashMovieObject("Myflash"); flashMovie.Rewind(); }function NextFrameFlashMovie() { var flashMovie=getFlashMovieObject("Myflash"); // 4 is the index of the property for _currentFrame // currentFrame=flashMovie.TGetProperty("/", 4); var currentFrame = flashMovie.CurrentFrame(); var nextFrame=parseInt(currentFrame+1); if (nextFrame>=15) nextFrame=0; flashMovie.GotoFrame(nextFrame); }function PrevFrameFlashMovie() { var flashMovie=getFlashMovieObject("Myflash"); // 4 is the index of the property for _currentFrame //var currentFrame=flashMovie.TGetProperty("/", 4); var currentFrame = flashMovie.CurrentFrame(); var prevFrame=parseInt(currentFrame-1); if (prevFrame<=0) prevFrame=0; flashMovie.GotoFrame(prevFrame); }function GotoFrameFlashMovie(frame) { var flashMovie=getFlashMovieObject("Myflash"); var frametogo=parseInt(frame); flashMovie.GotoFrame(frametogo); }function ZoominFlashMovie() { var flashMovie=getFlashMovieObject("Myflash"); flashMovie.Zoom(90); }function ZoomoutFlashMovie() { var flashMovie=getFlashMovieObject("Myflash"); flashMovie.Zoom(110); }function SendDataToFlashMovie() { var flashMovie=getFlashMovieObject("Myflash"); flashMovie.SetVariable("/:mytext", document.getElementById("data").value); }function ReceiveDataFromFlashMovie() { var flashMovie=getFlashMovieObject("Myflash"); document.getElementById("data").value=flashMovie.GetVariable("/:mytext"); //document.controller.Data.value=message; } </SCRIPT><META name="GENERATOR" content="MSHTML 9.00.8112.16450"> </HEAD><BODY> <DIV id="content"><center> <table width="" height="" cellpadding="0" cellspacing="0" border="0"> <tr> <td align="center" valign="middle"> <OBJECT id="Myflash" codeBase="http://active.macromedia.com/flash2/cabs/swflash.cab#version=4,0,0,0" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="440" height="300"><PARAM name="movie" value="test01.swf"> <PARAM name="quality" value="high"> <PARAM name="play" value="false"> <PARAM name="bgcolor" value="#FFFFFF"> <EMBED height="480" name="Myflash" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" width="900" src="test01.swf" bgcolor="#FFFFFF" quality="high" swliveconnect="true" play="false"></OBJECT><BR><BR><BR><INPUT onclick="PlayFlashMovie()" value="播放" type="button"> <INPUT onclick="StopFlashMovie()" value="暂停" type="button"> <INPUT onclick="RewindFlashMovie()" value="停止" type="button"> <INPUT onclick="NextFrameFlashMovie()" value="下一帧" type="button"> <INPUT onclick="PrevFrameFlashMovie()" value="上一帧" type="button"> <INPUT onclick="ZoominFlashMovie()" value="放大" type="button"> <INPUT onclick="ZoomoutFlashMovie()" value="缩小" type="button"> <INPUT onclick="GotoFrameFlashMovie(10)" value="第10帧" type="button"> <!INPUT onclick="SendDataToFlashMovie()" value="发送数据" type="button"> <!INPUT onclick="ReceiveDataFromFlashMovie()" value="接收数据" type="button"> <!INPUT id="data" type="text"> </DIV><SCRIPT language="JavaScript" charset="gb2312" src="files/stat.js"> </SCRIPT></td> </tr> </table> </center></SPAN> </BODY></HTML>————————————————————————————————
加载的flash资源如下:http://www.iamued.com/demo/flashjs/
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货