Тема: Preolader Sound'a
Показать сообщение отдельно
Старый 08.05.2007, 13:00
screamge вне форума Посмотреть профиль Отправить личное сообщение для screamge Посетить домашнюю страницу screamge Найти все сообщения от screamge
  № 2  
Ответить с цитированием
screamge
Ветеран форума
 
Аватар для screamge

Регистрация: Jul 2006
Адрес: Грузия, Тбилиси
Сообщений: 2,675
цитирию хелп:

Код:
// Create a new Sound object to play the sound.
var songTrack:Sound = new Sound();
// Create the polling function that tracks download progress.
// This is the function that is "polled." It checks 
// the downloading progress of the Sound object passed as a reference.
function checkProgress (soundObj:Object):Void {
    var numBytesLoaded:Number = soundObj.getBytesLoaded();
    var numBytesTotal:Number = soundObj.getBytesTotal();
    var numPercentLoaded:Number = Math.floor(numBytesLoaded / numBytesTotal * 100);
    if (!isNaN(numPercentLoaded)) {
        trace(numPercentLoaded + "% loaded.");
    }
};
// When the file has finished loading, clear the interval polling.
songTrack.onLoad = function ():Void {
    trace("load complete");
    clearInterval(poll);
};
// Load streaming MP3 file and start calling checkProgress(),
songTrack.loadSound("http://www.helpexamples.com/flash/sound/song1.mp3", true);
var poll:Number = setInterval(checkProgress, 100, songTrack);
__________________
Free-lance | Twitter | Me