Flash
制作工程:actionscript 2.0
プリロードムービー:(旧バージョン対応)フレーム2に設定するタイプ
1. root|フレームアクションの設定
| 1 | 2 | 3 | 4 | |
| action | ○ |
a ○ |
○□ |
|
| bar | ●□ |
●→ |
||
| loading | ●□ |
●→ |
||
| わく | ●□ |
●→ |
||
- [root]
- action|フレーム2
-
if (_framesloaded>=_totalframes) {
this.gotoAndPlay(_currentframe+1);
} else {
this.gotoAndPlay(_currentframe-1);
}
2. barレイヤー|MC(preload)|MC(progressBar)、ダイナミックテキストの設定
| 1 | 2 | |
| action | a ○ |
a ○ |
| progressBar | ●□ |
|
| text | ●□ |
|
- [root>MC(preload)]
- action|フレーム1
-
loadedSize = _root.getBytesLoaded();
totalSize = _root.getBytesTotal();
if (loadedSize>=totalSize) {
_root.play();
} else {
parcent = (loadedSize/totalSize)*100;
gDownloaded = Math.round(parcent);
progressBar.setBar(gDownloaded);
_root.stop();
}
- action|フレーム2
- this.gotoAndPlay(_currentFrame-1);
- progressBar|MC
-
基準点(左)から横長のMCを作成。
インスタンス名:progressBar
MC内|フレーム1
oneStep=_width/100; //1%あたりの長さをグローバル変数に保持
function setBar(parcent) {
_width = oneStep*parcent;
}
- text|テキストエリア
-
テキストツールでテキストエリア作成。
インスタンス名:preload
(プロパティパネルで)変数:gDownloaded
※主な設定は以上。rootのloadingレイヤー(静止テキスト)と、わくレイヤーは装飾用。


