加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

Flash加入收藏夹,设为首页等使用函数

发布时间:2020-12-15 06:28:09 所属栏目:百科 来源:网络整理
导读:? 设为首页: btn.onRelease{ getURL("javascript :document.body.style.behavior="url(#default#homepage)";document.body.sethomepage("http://www.1netmedia.cn ")","_self"); } 加入收藏夹: btn.onRelease{ getURL("javascript :window.external.addf

?设为首页:
btn.onRelease{
getURL("javascript :document.body.style.behavior="url(#default#homepage)";document.body.sethomepage("http://www.1netmedia.cn ")","_self");
}



加入收藏夹:
btn.onRelease{
getURL("javascript :window.external.addfavorite("http://www.1netmedia.cn","『一网传媒』")","_self");
}


增:设为首页,加入收藏夹方法:


一,用getURL的方法:

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

收藏夹:
on (release) {
getURL("javascript:void window.external.AddFavorite('http://www.flashempire.com','闪客帝国');","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=JavaScript>这句的前面添加一句<a href="javascript:"></a>


============================================================================

判断输入是否为数字的函数:
btn.onRelease{
if(Number(pass)==NaN){
//判断输入是否为数字 pass="";
}
}

?


检查E-MAIL的函数:
function checkemail(email) {
var str = new String(email);
var arr_email = str.split("@");
if ((arr_email.length != 2) || (arr_email[1].indexOf(".")<1)) {
return (false);
} else {
return (true);
}
}


鼠标双击问题:
lsn_DbClick = new Object();
lsn_key = new Object();
lsn_DbClick.onMouseDown = function() {
clickTime = getTimer();
if (clickTime-lastClickTime<=300) {
trace("双击了鼠标");
}
lastClickTime = clickTime;
};
Mouse.addListener(lsn_DbClick);
time = getTimer()-down_time;
if (time<300) {
//双击后的代码部分
}
down_time = getTimer();



怎样设as,拒绝影片被人用loadMovie导入:
_root._name = "nn"; this.onEnterFrame = function() { if (this._name != "nn" || _root.getDepth() != -16384) { this.unloadMovie(); } };

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读