實用AS原始碼:純AS的Loading

來源:互聯網
上載者:User
loading|原始碼 //**********************************************************
//Copyright (C) 2006-2026
//黑白人動畫工作室
//Email:syxu@3c800.com
//www.3c800.com
//**********************************************************
/*
FLASH開發通用模板
*/
//---------------------------------------------------------
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();
  //下載完成播放
 }
};
//調試時按Ctrl+B
//-------------------

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.