Форум Flasher.ru

Форум Flasher.ru (http://www.flasher.ru/forum/index.php)
-   ActionScript 1.0/2.0 (http://www.flasher.ru/forum/forumdisplay.php?f=93)
-   -   Неверное отображение данных о загрузке (http://www.flasher.ru/forum/showthread.php?t=119605)

Ilut 25.12.2008 03:23

Неверное отображение данных о загрузке
 
Доброе время суток. Я написал прелоадер mp3 файлов. Запускаю флешку в браузере. Но флешка показывает что количество загруженых байтов равно 0, а общее кол-во байтов которые надо загрузить undefined. Сам файл подгружается. Подскажите пожалуйста в чем проблема.

Код AS1/AS2:

function OnStart()
{                       
        roma_sound1_o01.preloadSound("sounds\\tcas\\tcas_o01.mp3",false);
}
roma_sound1_o01=new Sound();
 
 
        Sound.prototype.checkLoadProgress=function()
        {
                var kbLoaded=Math.floor(this.getBytesLoaded()/1024);
                var kbTotal=Math.floor(this.getBytesTotal()/1024);
 
                this.onBytesLoaded(this.getBytesLoaded(),this.getBytesTotal(),kbLoaded,kbTotal);
 
                if(this.getBytesLoaded()>5 && this.getBytesLoaded()==this.getBytesTotal())
                {
                        this.clearLoadCheck();
                }               
        }
 
        Sound.prototype.clearLoadCheck=function(){
                if(this.loaderID)
                {
                        clearInterval(this.loaderID);
                }
        }
 
        Sound.prototype.preloadSound = function(url, isStreaming)
        {
                this.clearLoadCheck();
                this.loadSound(url,isStreaming);
                this.loaderID=setInterval(this,"checkLoadProgress",200);
        }               
 
        roma_sound1_o01.onLoad=function(success)
        {               
                //fscommand("debugtest",success);
                if(success)
                {
                trace("Done loading");               
                this.start();
                }
                else
                {                       
                        trace("faild");
                        this.clearLoadCheck();
                }
        }
 
        roma_sound1_o01.onBytesLoaded=function(bytesLoaded,bytesTotal,kbLoaded,kbTotal)
        {
                trace(kbLoaded+" / "+kbTotal);
                prlS.l_text.text="Загрузка: "+Math.round(kbLoaded*100/kbTotal)+"%";               
 
        }



Часовой пояс GMT +4, время: 22:39.

Copyright © 1999-2008 Flasher.ru. All rights reserved.
Работает на vBulletin®. Copyright ©2000 - 2026, Jelsoft Enterprises Ltd. Перевод: zCarot
Администрация сайта не несёт ответственности за любую предоставленную посетителями информацию. Подробнее см. Правила.