一,用getURL的方法:
设为首页:
on (release) {
getURL("javascript :void(document.links[0].style.behavīor='url(#default#homepage)');void document.links[0].setHomePage(' http://www.flashempire.com/');", "_self", "POST");
}
加入收藏夹:
on (release) {
getURL("javascript :void window.external.AddFavorite(' http://www.flash8.net','闪吧');", "_self", "POST");
}
二,用fscommand的方法,有点复杂
1,先在 flash的按钮上添加代码:
首页:
on (release) {
fscommand("setHomePage", " http://www.flash8.net"/' target="_blank" > http://www.flash8.net";);
}
收藏夹:
on (release) {
fscommand("addFavorite", " http://www.flash8.net|闪吧");
}
然后在发布设置中选择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.behavīor = "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[0].style.behavīor='url(#default#homepage)');void document.links[0].setHomePage(' http://www.flashempire.com/');", "_self", "POST");
}
加入收藏夹:
on (release) {
getURL("javascript :void window.external.AddFavorite(' http://www.flash8.net','闪吧');", "_self", "POST");
}
二,用fscommand的方法,有点复杂
1,先在 flash的按钮上添加代码:
首页:
on (release) {
fscommand("setHomePage", " http://www.flash8.net"/' target="_blank" > http://www.flash8.net";);
}
收藏夹:
on (release) {
fscommand("addFavorite", " http://www.flash8.net|闪吧");
}
然后在发布设置中选择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.behavīor = "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>
本文介绍了使用Flash制作网页时如何通过两种方法实现将网站设置为浏览器的首页及添加到收藏夹的功能。一种方法是利用getURL函数,另一种则是通过fscommand命令配合特定的HTML设置来实现。
1012

被折叠的 条评论
为什么被折叠?



