Your Ad Here

Posted By

tetsulog on 07/15/06


Tagged

flame


Versions (?)

プリローダー


 / Published in: ActionScript
 

・2フレーム目に「cont」 ・ダイナミックテキスト名「parcentagetxt」 ・ローダー名(ムービークリップ)「barmc」 Source: onClipEvent (load) { //最初は非表示に this._xscale = 0; }

  1. //まず最初に再生を停止
  2. this.stop();
  3. //■■=====変数の初期化
  4. //パーセンテージ
  5. nParcentage = 0;
  6. //全体のバイト数を取得
  7. nTotal = this.getBytesTotal();
  8. //■■=====function定義
  9. function xPreload() {
  10. //読み込み済みバイト数を取得
  11. nLoaded = this.getBytesLoaded();
  12. //読み込み状態を監視して、読み込み終了なら指定フレームへ移動
  13. //読み込み終了前ならパーセンテージとバーを操作
  14. if (nTotal<=nLoaded) {
  15. this.gotoAndStop("cont");
  16. //プリロード処理を消去
  17. delete this.onEnterFrame;
  18. } else {
  19. //パーセンテージを計算
  20. nParcentage = Math.round(100*nLoaded/nTotal);
  21. //バーの長さを変更
  22. bar_mc._xscale = nParcentage;
  23. //パーセンテージのテキストを変更
  24. parcentage_txt.text = nParcentage+" %";
  25. }
  26. }
  27. //■■=====読み込み判定処理を組み込み
  28. this.onEnterFrame = xPreload;

Report this snippet  

You need to login to post a comment.