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

By:www.51as.com Date:2009-04-26

设置首页:

btn.onRelease{
geturl("javascript :document.body.style.behavior=\"url(#default#homepage)\";document.body.sethomepage(\http://www.51as.com \)", "_self");
}

 

加入收藏夹:

btn.onRelease{
geturl("javascript :window.external.addfavorite(\"http://www.51as.com\")", "_self");
}

 

判断输入是否为数字的函数:

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();
}
};

参与讨论去: 艾睿(Airia) 交朋友去:友吧推荐文章去:网站贴吧
企业招聘

北京中视力天文化传媒有限公司

公司简介:北京中视力天文化传媒有限公司,是CCTV.com央视国际网络有限公司投资的互联网研发团队。我们是天使的使者。。。

招聘FlashAS程序员详情点击

Copyright 2007-2008 51AS.com Extended in kingcms 鲁ICP备06001158号