Flash CS3 ドキュメンテーション |
|||
| ActionScript 2.0 リファレンスガイド > ActionScript 言語エレメント > グローバルプロパティ > _soundbuftime プロパティ | |||
_soundbuftime:Number = integer
ストリーミングサウンドをバッファする秒数を設定します。デフォルト値は 5 秒です。
対応バージョン : ActionScript 1.0、Flash Player 4
integer:Number - SWF ファイルのストリーミングが開始するまでの秒数。
次の例では、MP3 ファイルをストリーミングし、サウンドをバッファした後でユーザーに対して再生します。実行時にテキストフィールドが 2 つ作成され、タイマー情報とデバッグ情報が収められます。_soundbuftime プロパティは、MP3 を 10 秒間バッファするように設定されます。MP3 用に新しい Sound オブジェクトインスタンスが作成されます。
// create text fields to hold debug information.
this.createTextField("counter_txt", this.getNextHighestDepth(), 0, 0, 100, 22);
this.createTextField("debug_txt", this.getNextHighestDepth(), 0, 20, 100, 22);
// set the sound buffer to 10 seconds.
_soundbuftime = 10;
// create the new sound object instance.
var bg_sound:Sound = new Sound();
// load the MP3 sound file and set streaming to true.
bg_sound.loadSound("yourSound.mp3", true);
// function is triggered when the song finishes loading.
bg_sound.onLoad = function() {
debug_txt.text = "sound loaded";
};
debug_txt.text = "sound init";
function updateCounter() {
counter_txt.text++;
}
counter_txt.text = 0;
setInterval(updateCounter, 1000);
このページに新しいコメントが追加された場合に、電子メールでの通知を希望する。 | コメントレポート
現在のページ: http://livedocs.adobe.com/flash/9.0_jp/main/00001245.html