Visualizzazione dei risultati da 1 a 3 su 3
  1. #1

    [AS2] Problemi con Sound

    Ho una classe dove gestisco gli mp3 caricati esternamente e ho un metodo
    public function LoadMusic():Void{
    var MySound:Sound;
    var path:MusicZen = this;
    MySound = new Sound();
    MySound.loadSound(MyMp3,false);
    who.onEnterFrame = function(){
    var car:Number,
    tot:Number,
    perc:Number;
    car = Number(MySound.getBytesLoaded());
    tot = Number(MySound.getBytesTotal());
    perc = Math.round((car*100)/tot);
    this.music = "loading "+perc+"%";
    if(car >= tot && tot > 0){
    delete this.onEnterFrame; this.music = "";
    }
    }
    MySound.start(0,999);
    }

    il problema è che se metto
    MySound.loadSound(MyMp3,false);
    non si sente una mazza, ma se metto l'audio in streaming
    MySound.loadSound(MyMp3,true);
    si sente una volta e basta, perchè?

  2. #2
    Utente di HTML.it L'avatar di and80
    Registrato dal
    Mar 2003
    Messaggi
    15,182

    Re: [AS2] Problemi con Sound

    Originariamente inviato da darkmavis
    Ho una classe dove gestisco gli mp3 caricati esternamente e ho un metodo
    public function LoadMusic():Void{
    var MySound:Sound;
    var path:MusicZen = this;
    MySound = new Sound();
    MySound.loadSound(MyMp3,false);
    who.onEnterFrame = function(){
    var car:Number,
    tot:Number,
    perc:Number;
    car = Number(MySound.getBytesLoaded());
    tot = Number(MySound.getBytesTotal());
    perc = Math.round((car*100)/tot);
    this.music = "loading "+perc+"%";
    if(car >= tot && tot > 0){
    delete this.onEnterFrame; this.music = "";
    }
    }
    MySound.start(0,999);
    }

    il problema è che se metto
    MySound.loadSound(MyMp3,false);
    non si sente una mazza, ma se metto l'audio in streaming
    MySound.loadSound(MyMp3,true);
    si sente una volta e basta, perchè?
    per la prima

    per la seconda prova a mettere subito dopo MySound.loadSound(MyMp3,true);
    codice:
    MySound.onSoundComplete=function(){
    MySound.start(0,1);
    }
    e forse va

  3. #3

    Re: Re: [AS2] Problemi con Sound

    Originariamente inviato da and80
    per la prima

    per la seconda prova a mettere subito dopo MySound.loadSound(MyMp3,true);
    codice:
    MySound.onSoundComplete=function(){
    MySound.start(0,1);
    }
    e forse va
    Funge! Grazie mille and

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.