HTML完整代码:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";'" target=&quo ... w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang= ... sp;lang="zh-CN">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>javascript_to_flash</title>
<SCRIPT LANGUAGE=JavaScript>
<!--
function doPassVar(args){
var sendText = args.value;
window.document.myFlash.SetVariable("myVar", sendText);
}
file://-->
</SCRIPT>
</head>
<body bgcolor="#003463">
<table width="200" border="0" align="center">
<tr>
<td>
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/sho ... sh/swflash.cab#version=7,0,0,0" width="200" height="150" id="myFlash" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="javascript_to_flash.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#003463" />
<embed src="javascript_to_flash.swf" quality="high" bgcolor="#003463" width="200" height="150" swLiveConnect="true" name="myFlash" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>
</td>
</tr>
</table>
<FORM METHOD=POST ACTION="">
<div align="center"><font color="#FFFFFF">请输入:</font> <textarea name="sendText" onkeyup="doPassVar(this)" rows="1" cols="42"></textarea>
</div>
</FORM>
<p align="left"> <font color="ffffff" face="宋体" > </font></p>
</body>
</html>
////////////////////// 以下是网上搜集
1,先在flash的按钮上添加代码:
首页:
on (release) {
fscommand("sethomepage", ;;
}
收藏夹:
on (release) {
fscommand("addfavorite", |新客网);
}
然后在发布设置中选择flash with fscommand,发布成html
2,修改html:
找到
// handle all the the fscommand messages in a flash movie
function sethomepage_dofscommand(command, args) {
}
这一段,修改成:
// handle all the the fscommand messages in a flash movie
function sethomepage_dofscommand(command, args) {
var sethomepageobj = internetexplorer ? sethomepage : document.sethomepage;
if (command == "sethomepage") {
document.l inks[0].style.behavior = "url(#default#homepage)";
document.l inks[0].sethomepage(args);
} else if (command == "addfavorite") {
args = args.split("|");
window.external.addfavorite(args[0], args[1]);
}
}
最新相关文章
发表评论