[AS3]as3与js通信源代码(3)
!DOCTYPEhtmlPUBLIC-//W3C//DTDXHTML1.0Transitional//ENhttp://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd html xmlns = http://www.w3.org/1999/xhtml lang = en xml:lang = en head title TESTASTOJS /
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
- <head>
- <title> TEST AS TO JS </title>
- <head>
- <script type="text/javascript">
- function getSwf(movieName)
- {
- if (navigator.appName.indexOf("Microsoft") != -1)
- {
- return window[movieName];
- }
- else
- {
- return document[movieName];
- }
- }
- function addMes(str)
- {
- var mes = (str.value == null)?str:str.value;
- getSwf("myFlash").receiveMes(mes);
- }
- function sendMes(str)
- {
- var mes = (str.value == null)?str:str.value;
- window.document.myFlash.backMes(mes);
- }
- //iframe
- // Major version of Flash required
- var requiredMajorVersion = 9;
- // Minor version of Flash required
- var requiredMinorVersion = 0;
- // Minor version of Flash required
- var requiredRevision = 0;
- function moveIFrame(x,y,w,h)
- {
- var frameRef=document.getElementById("myFrame");
- frameRef.style.left=x;
- frameRef.style.top=y;
- var iFrameRef=document.getElementById("myIFrame");
- iFrameRef.width=w;
- iFrameRef.height=h;
- }
- function hideIFrame()
- {
- document.getElementById("myFrame").style.visibility="hidden";
- }
- function showIFrame()
- {
- document.getElementById("myFrame").style.visibility="visible";
- }
- function loadIFrame(url)
- {
- document.getElementById("myFrame").innerHTML = "<iframe id='myIFrame' src='" + url + "'frameborder='0'></iframe>";
- }
- </script>
- <body>
- <center>
- <object width = "550" height = "400" id = "myFlash">
- <param name= "allowScriptAccess" value = "always"/>
- <param name= "movie" value = "AsToJs.swf" />
- <param name = "quality" value = "high"/>
- <embed
- src = "AsToJs.swf"
- width = "550"
- height = "400"
- wmode = "transparent"
- name = "myFlash"
- allowScriptAccess = "always"
- type="application/x-shockwave-flash"
- pluginspage="http://www.macromedia.com/go/getflashplayer"/>
- </center>
- </object>
- <form name = "form1" action = "#">
- <input type = "text" name = "sendText" size = "65" maxlength = "200" />
- <label>
- <input type = "button" name = "button" id = "button" value = "send to Flash" onclick = "addMes(sendText)" />
- </label>
- </form>
- <!-- <iframe name="_history" src="history.htm" frameborder="0" scrolling="no" width="22" height="0"></iframe> -->
- <div id="myFrame" class = "box" style="top:0px;z-index:6;position:absolute;background-color:transparent;border:0px;visibility:hidden;"></div>
- <body>
- </html>
热门文章推荐
- [HLS]做自己的m3u8点播系统使用HTTP Live Streaming(HLS技术)
- [FMS]FMS流媒体服务器配置与使用相关的介绍
- [AS3]什么是M3U8,与HTML5的区别是什么
- AS2.0 让flash自适应全屏,并且不自动缩放
- [AS3]as3.0的sound类常用技巧整理
- [AS3]as3与ByteArray详解、ByteArray介绍、ByteArray用法
- 关于RTMP,RTMPT,RTMPS,RTMPE,RTMPTE协议的介绍
- [JS]分享浏览器弹出窗口不被拦截JS示例
请稍候...