{
    分享网正式开通,我们为大家提供免费资源,欢迎大家踊跃投稿!

flash设为首页 加入收藏

一,用getURL的方法:

首页:
on (release) {
getURL("java script:void(document.links[0].style.behavior='url(#default#homepage)');void document.links[0].setHomePage('http://www.flashempire.com/');", "_self", "POST");
}

收藏夹:
on (release) {
getURL("java script:void window.external.AddFavorite('http://www.flashempire.com','闪客帝国');", "_self", "POST");
}


二,用fscommand的方法,有点复杂

1,先在flash的按钮上添加代码:

首页:
on (release) {
fscommand("setHomePage", "http://www.flashempire.com");
}
收藏夹:
on (release) {
fscommand("addFavorite", "http://www.flashempire.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=java script>这句的前面添加一句<a href="java script:"></a>


在线预览
资源均来自第三方,谨慎下载,前往第三方网站下载


米微资源分享网 , 版权所有丨本站资源仅限于学习研究,严禁从事商业或者非法活动!丨本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:flash设为首页 加入收藏
喜欢 ()分享 (0)