第二种方法是通过用fscommand的方法,比上面一个要复杂一些。首先在Flash的按钮上添加ActionScript脚本代码
设为首页
on (release) { fscommand("setHomePage", "http://您的
网站地址"); }
加入收藏夹
on (release) { fscommand("addFavorite", "http://
网站地址|
网站名称"); }
在发布Flash动画时选上HTML,在Template下拉菜单中选择Flash with fscommand,发布出html页面接着要对发布出来的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>

发表评论