设为首页:
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','闪客帝国');", "_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=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导入:
if (this._name != "nn" || _root.getDepth() != -16384) {
this.unloadMovie();
}
};