分享一篇关于利用js不断的给flash传送值的实现代码,有需要的朋友可以参考一下。
| 代码如下 |
|
|
<!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">
<head>
<meta. http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<script. type="text/javascript" src="swfobject.js" ></script>
</head>
<body nload="setInterval(callFlash,1000)">
<input type="button" id="showBtn" value="隐藏" nclick="showFlash()" />
<div id="flashcontent"></div>
</body>
<script>
var so=new SWFObject("fl.swf","flash","800","600","9");
so.write("flashcontent");
function callFlash(){
document.getElementById("flash").showTxt(Math.random());
}
function showFlash(){
var _div=document.getElementById("flashcontent");
var _txt=document.getElementById("showBtn");
if(_div.style.display=="none"){
_div.style.display="";
_txt.value="隐藏";
}else{
_div.style.display="none"
_txt.value="显示";
}
}
</script>
</html>
|