JS AS交互 在html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!-- saved from url=(0014)about:internet --> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <head> <title>测试</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <script type="text/javascript" src="swfobject.js"></script> <style type="text/css" media="screen"> html, body { height:100%; font-size:12px; color:#CCCCCC} body { margin:0; padding:0; overflow:auto; text-align:center; background-color: #000000; } </style> </head> <body onresize = "onResize()" scroll="no"> <div id="flashContent"><br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <table width="0" border="1" cellpadding="15" cellspacing="0" bordercolor="#464646" bgcolor="#1E1E1E"> <tr> <td><table width="0" border="0" align="center" cellpadding="20" cellspacing="0" bgcolor="#333333"> <tr> <td><table width="261" height="84" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#2B2B2B" id="login" style="display:block;"> <tr> <td height="25" align="center" bgcolor="#3D3D3D">账 号:</td> <td height="25" align="left" bgcolor="#3D3D3D" style="padding-left:5px;"><input name="username" type="text" id="username" value="ddff"/></td> </tr> <tr> <td height="25" align="center" bgcolor="#3D3D3D">IP地址:</td> <td height="25" align="left" bgcolor="#3D3D3D" style="padding-left:5px;"><label> <select name="ipAddress" id="ipAddress" onchange="document.getElementById('ip').innerHTML=document.getElementById('ipAddress').options[document.getElementById('ipAddress').selectedIndex].value"> <option value="192.168.0.199">【服务器】</option> </select> </label></td> </tr> <tr> <td height="25" align="center" bgcolor="#3D3D3D">端 口:</td> <td height="25" align="left" bgcolor="#3D3D3D" style="padding-left:5px;"><input name="port" type="text" id="port" value="80"/></td> </tr> <tr> <td height="25" align="center" bgcolor="#3D3D3D">区 号:</td> <td height="25" align="left" bgcolor="#3D3D3D" style="padding-left:5px;"><input name="quHao" type="text" id="quHao" value="0"/></td> </tr> <tr> <td height="25" align="center" bgcolor="#3D3D3D">平 台:</td> <td height="25" align="left" bgcolor="#3D3D3D" style="padding-left:5px;"><label> <select name="performAddress" id="performAddress"> <option value="website" >【website】</option> </select> </label></td> </tr> <tr> <td height="24" align="right" bgcolor="#3D3D3D"> </td> <td height="24" align="left" bgcolor="#3D3D3D" style="padding-left:5px;"><table width="0" border="0" cellspacing="0" cellpadding="0"> <tr> <td><input type="submit" name="Submit" value="提交" onclick="dolink()" /></td> <td> <span id="ip"></span></td> </tr> </table></td> </tr> </table></td> </tr> </table></td> </tr> </table> </div> <script> String.prototype.GetValue= function(para) { var reg = new RegExp("(^|&)"+ para +"=([^&]*)(&|$)"); var r = this.substr(this.indexOf("\#")+1).match(reg); if (r!=null) return unescape(r[2]); return null; } <!-- For version detection, set to min. required Flash Player version, or 0 (or 0.0.0), for no version detection. --> var swfVersionStr = "0.0.0"; <!-- To use express install, set to playerProductInstall.swf, otherwise the empty string. --> var url = location.href var xiSwfUrlStr = "playerProductInstall.swf"; var state = getState(); //0未设置,1不要弹出,2保存收藏夹 var m_url = "http://192.168.1.167"; var m_title = "倚天167测试"; window.onbeforeunload = function(evt) { var swf = document.getElementById("Testttt"); if(!swf)return; var str = swf.exitGame(); if(str != '') { // evt = evt || window.event // evt.returnValue=str; return str; } /* switch (state) { case 1: break; case 2: bookmark(m_url, m_title); break; default: evt = evt || window.event evt.returnValue = '确认结束当前游戏?'; } */ } function getState() { if (getCookie("yt")==null) { setCookie("yt", "yt", 365); return 2; } return 1; } function getCookie(c_name) { if (document.cookie.length > 0) { c_start = document.cookie.indexOf(c_name + "=") if (c_start != -1) { c_start = c_start + c_name.length + 1; c_end = document.cookie.indexOf(";", c_start); if (c_end == -1) { c_end = document.cookie.length; } return unescape(document.cookie.substring(c_start, c_end)); } } return null } function setCookie(c_name, value, expiredays) { var exdate = new Date(); exdate.setDate(exdate.getDate() + expiredays); // 使设置的有效时间正确。增加toGMTString() document.cookie = c_name + "=" + escape(value) + ((expiredays == null) ? "" : ";expires=" + exdate.toGMTString()); } function dolink() { var flashvars = {}; flashvars.account=document.getElementById("username").value flashvars.key=url.GetValue("key"); flashvars.tstamp=url.GetValue("tstamp"); flashvars.ip=document.getElementById('ipAddress').options[document.getElementById('ipAddress').selectedIndex].value; flashvars.port=document.getElementById("port").value; flashvars.pf=document.getElementById('performAddress').options[document.getElementById('performAddress').selectedIndex].value; flashvars.txAction_assis = ""; flashvars.seqid='sdfkasdlflsd34lkl239dflklsdf32kldsf323d2sd'; flashvars.zoneid=document.getElementById("quHao").value; flashvars.lunWebsite="http://sobar.soso.com/b/3007483_1792"; flashvars.ShengDanTimes='2012年世界末日-测试日期'; flashvars.merriIcon='1'; flashvars.twoEggs='1'; flashvars.loadFile="../../YiLoader/bin/YiLoader.swf"; flashvars.isRelease='false'; flashvars.activityGuide='1'; var params = {}; params.quality = "high"; params.bgcolor = "#000000"; params.allowscriptaccess = "always"; params.allowfullscreen = "true"; params.wmode="window"; var attributes = {}; attributes.id = "Testttt"; attributes.name = "Testttt"; attributes.align = "middle"; swfobject.embedSWF( "${swf}.swf", "flashContent", "${width}", "${height}", swfVersionStr, xiSwfUrlStr, flashvars, params, attributes); <!-- JavaScript enabled so display the flashContent div in case it is not replaced with a swf object. --> swfobject.createCSS("#flashContent", "display:block;text-align:left;"); <!--document.getElementById("login").style.display="none"--> } var alp = 1; function onResize() { var swf = document.getElementById("Testttt"); if(!swf)return; swf.attributes.width.nodeValue = 420; swf.attributes.height.nodeValue = 240; var width = document.body.clientWidth; var height = document.body.clientHeight; str=width+","+height if(parseInt(width) < 800)width = "800"; if(parseInt(height) < 500)height = "500"; swf.attributes.width.nodeValue = width; swf.attributes.height.nodeValue = height; } function bookmark(url,title){ if(navigator.userAgent.toLowerCase().indexOf("firefox") != -1){ setTimeout(function(){ _bookmark(url,title); },300); } else{ _bookmark(url,title); } } function _bookmark(url,title){ if (window.sidebar){ window.sidebar.addPanel(title, url,""); }else if( window.opera && window.print ){ var mbm = document.createElement('a'); mbm.setAttribute('rel','sidebar'); mbm.setAttribute('href',url); mbm.setAttribute('title',title); mbm.click(); } else if( document.all ) { window.external.AddFavorite(url,title); } } function inviteFriend() { } function inviteFriends() { var swf = document.getElementById("Testttt"); if(!swf)return; swf.inviteFriends(); } function chongzhi(url_params) { alert(url_params); chongzhiSuccess({context:"测试一下"}); } function chongzhiSuccess(opt){ var swf = document.getElementById("Testttt"); if(!swf)return; swf.chongzhiSuccess(opt); } function share(title,discrpt,sumary) { alert(discrpt); alert(sumary); } function openVipGift(token,openid) { } function moveIFrame(x,y) { var frameRef=document.getElementById("myFrame"); //alert(x+","+y); frameRef.style.left=x+'px'; frameRef.style.top=y+'px'; } 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='http://open.qzone.qq.com/like?url=http%3A%2F%2Fuser.qzone.qq.com%2F2202410325&type=button_num_user&width=400&height=90&style=3'frameborder='0'></iframe>"; // document.getElementById("myFrame").innerHTML = "<iframe id='myIFrame' src='http://follow.v.t.qq.com/index.php?c=follow&a=quick&name=Testttt_tx&style=1&t=1357699971151&f=1' frameborder='0' width='227' height='75'></iframe>"; document.getElementById("myFrame").innerHTML = "<iframe id='myIFrame' src='http://follow.v.t.qq.com/index.php?c=follow&a=quick&name=Testttt_tx&style=1&t=1357822729984&f=0' frameborder='0' scrolling='auto' width='167' height='75' marginwidth='0' marginheight='0'></iframe>"; } function moveZoneIFrame(x,y) { var frameRef=document.getElementById("zoneFrame"); frameRef.style.left=x+'px'; frameRef.style.top=y+'px'; } function hideZoneIFrame(){ document.getElementById("zoneFrame").style.visibility="hidden"; } function showZoneIFrame(){ document.getElementById("zoneFrame").style.visibility="visible"; } function loadQzoneFrame(url){ // document.getElementById("zoneFrame").innerHTML = "<iframe id='zoneIFrame' src='http://follow.v.t.qq.com/index.php?c=follow&a=quick&name=qzhuyongq&style=1&t=1342840663125&f=1' frameborder='0' width='227' height='75'></iframe>"; // document.getElementById("zoneFrame").innerHTML = "<iframe id='zoneIFrame' src='http://open.qzone.qq.com/like?url=http%3A%2F%2Fuser.qzone.qq.com%2F2202410325&type=button&width=400&height=30&style=3' frameborder='0'></iframe>"; document.getElementById("zoneFrame").innerHTML = "<iframe id='zoneIFrame' src='http://open.qzone.qq.com/like?url=http%3A%2F%2Fuser.qzone.qq.com%2F2202410325&type=button&width=400&height=30&style=3' frameborder='0' scrolling='no' style='width:167px;height:75px;'></iframe>"; } document.getElementById('ip').innerHTML=document.getElementById('ipAddress').options[document.getElementById('ipAddress').selectedIndex].value </script> </body> </html>