FLASH 里加入收藏、设为首页代码: 加入收藏: on (release) { getURL("javascript:window.external.AddFavorite(‘http://www.16sucai.com’,’ 郑州市冯特职业培训学校 ’);"); } 设为首页: getURL("javascript:document.all.link[0].style.behavior=’url(#default#homepage)’;document.all.link[0].setHomePage(‘http:// 您的网址 ’);");// 设为首页 // 加入收藏 on(release){ getURL("javascript:void window.external.AddFavorite(‘http://www.16sucai.com’,’ 网站名 ’);", "_self", "POST"; } // 设为首页 on(release){ getURL("javascript:void(document.links[0].style.behavior=’url(#default#homepage)’);void document.links[0].setHomePage(‘http://www.16sucai.com/’);", "_self", "POST"; } on (release){ getURL("javascript:void(document.links[0].style.behavior=’url(#default#homepage)’);void document.links[0].setHomePage(‘http://16sucai.com’);"); } 在 <body> 和 </body> 之间,加入以下代码: <A HREF=Javascript:></A> 一定要加! on (release) {getURL("javascript:void(document.links[0].style.behavior=’url(#default#homepage)’);void document.links[0].setHomePage(你的网址 ’);", "_self"); } “ 加入收藏 ” on(release) {getURL("javascript:window.external.AddFavorite(‘ 你的网址 ’,’ 站名 ’)"); } 一,用 getURL 的方法:首页:on (release) {getURL("javascript:void(document.links[0].style.behavior=’url(#default#homepage)’);void document.links[0].setHomePage(‘http://www.16sucai.com/‘);", "_self", "POST"); } 收藏夹:on (release) {getURL("javascript:void window.external.AddFavorite(‘http://www.16sucai.com‘,’ 闪客帝国 ’);", "_self", "POST"); } 二,用 fscommand 的方法,有点复杂 1,先在 flash 的按钮上添加代码:首页:on (release) {fscommand("setHomePage", "http://www.16sucai.com"); } 收藏夹:on (release) {fscommand("addFavorite", "http://www.16sucai.com| 闪客帝国 "); } 然后在发布设置中选择 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.links[0].style.behavior = "url(#default#homepage)"; document.links[0].setHomePage(args); } else if (command == "addFavorite") {args = args.split("|"); window.external.AddFavorite(args[0], args[1]); } } 最后,如果 html 里一个链接都没有,还需在 <SCRIPT LANGUAGE=JavaScript> 这句的前面添加一句 <a href="javascript:"></a> on (release) { getURL("javascript:void(document.links.style.behavior=’url(#default#homepage)’);void document.links.setHomePage (‘http://www.16sucai.com‘)", "_self", "POST"); } 多种设为首页代码语法 - 在网页和 FLASH 中将您的网站设为首页 首先来说说如何在网页中将您的站点设为首页。 在网页中设为首页的常用代码语法: 1. 文字链接型: 添加的代码语法为: 程序代码 <a onclick="this.style.behavior=’url(#default#homepage)’;this.setHomePage(‘http://www.16sucai.com/’);" href="#"> 设为首页 </a> 2. 按钮链接型: 添加的代码语法为: 程序代码 <input TYPE="button" VALUE=" 设为首页 " onclick="this.style.behavior=’url(#default#homepage)’;this.setHomePage(‘http://www.16sucai.com//lovewall/);" href="#"> 3. 图片链接型: 添加的代码语法为: 程序代码 <a style="cursor:hand" onclick="this.style.behavior=’url(#default#homepage)’; this.setHomePage(‘www.wlzxy.com’);"> <img width=16 height=16 border=0 src=" 图片地址 "> <u> 设为首页 </u></a> 4. 离开时自动提示设为首页代码语法: 程序代码 <body onunload="BASEBody.style.behavior=’url(#default#homepage)’;if(!(BASEBody.isHomePage(‘http://www.16sucai.com’)))BASEBody.setHomePage(‘http://www.16sucai.com/’);"> 5. 打开页面时自动弹出窗口询问是否设为首页代码语法: 先将以下 JS 代码放在 <head></head> 标签之间: 程序代码 <script language="javascript"> function myhomepage(){ this.homepage.style.behavior=’url(#default#homepage)’;this.homepage.sethomepage(‘http://www.16sucai.com’); } </script> <p align="center"><a href="http://www.16sucai.com/" name="homepage" onclick="myhomepage();"></a> 再将下面代码加入 <body> 标签内: 程序代码 onload="myhomepage();" 6. 鼠标指向时提示设为首页代码语法: 将下列代码插入 <body> 标签中: 程序代码 <a href="http://www.16sucai.com/" onmouseover="this.style.behavior=’url(#default#homepage)’;this.setHomePage(‘http://www.16sucai.com/’);" target="_blank"> 设为首页 </a> ——————————————————————————- 下面来说说在 Flash 中设为首页代码语法,毕竟现在 Flash 做站可是十分的流行呀,视觉效果很好。 1. 用 getURL 的方法添加的代码语法: 在 flash 的按钮上添加以下代码语法即可: 程序代码 on (release) { getURL("javascript:void(document.links[0].style.behavior=’url(#default#homepage)’);void document.links[0].setHomePage(‘http://www.16sucai.com/’);", "_self", "POST"); } 2. 用 fscommand 的方法添加的代码语法: 先在 flash 的按钮上添加如下代码语法: 程序代码 on (release) { fscommand("setHomePage", "http://www.16sucai.com/"); } 然后在发布设置中选择 flash with fscommand,发布成 html,再修改 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.links[0].style.behavior = "url(#default#homepage)"; document.links[0].setHomePage(args); } else if (command == "addFavorite") { args = args.split("|"); window.external.AddFavorite(args[0], args[1]); } } 最后,如果 html 文件里一个链接都没有,还需要在 <Script language=JavaScript> 这句的前面添加一句 <a href="javascript:"></a> 目前个人所了解的常用的就这么多了,如果您有更好的方法,也欢迎您的指教。 |