AS制作Loading源代码

来源:互联网 发布:编程用电脑配置 编辑:程序博客网 时间:2024/05/08 13:30
stop();
_quality = "MEDIDU";
//"LOW"、"HIGH"、"BEST"
Stage.scaleMode = "noScale";
//"exactFit"、"showAll"、"noBorder"
fscommand("fullscreen", true);
//"quit"、"allowscale"、" showmenu "、"exec "、"trapallkeys"
//---------------------------------------------------------
//右键菜单版权信息和导航系统
rightmeun = new ContextMenu();
rightmeun.hideBuiltInItems();
rightmeun.customItems.push(new ContextMenuItem("rightmenu_item1", dj_menu0, false));
rightmeun.customItems.push(new ContextMenuItem("rightmenu_item2", dj_menu1, true));
rightmeun.customItems.push(new ContextMenuItem("rightmenu_item3", dj_menu2, false));
function dj_menu0() {
//此处是你的代码...
}
function dj_menu1() {
//此处是你的代码...
}
function dj_menu2() {
//此处是你的代码...
}
_root.menu = rightmeun;
//---------------------------------------------------------
//自定义函数
function huanshu() {
//此处是你的代码...
}
//---------------------------------------------------------
//纯AS的Loading...
function Draw(nam, de, d, al) {
na = createEmptyMovieClip(nam, de);
na.lineStyle(d, 0xFF6600, al);
//颜色
na._x = 200;
//起始X
na._y = 200;
//起始Y
na.lineTo(120, 0);
//宽度
}
onEnterFrame = function () {
var a = getBytesTotal();
//总大小
var b = getBytesLoaded();
//已下载
if (b<a) {
   Draw("b1", 1, 3, 20);
   //阴影
   Draw("b2", 2, 3, 100);
   //进度条
   b2._xscale = b/a*100;
   //进度条宽度百分比
} else {
   delete onEnterFrame;
   b1.removeMovieClip();
   //删除进度条
   b2.removeMovieClip();
   play();
   //下载完成播放
}
};
原创粉丝点击