purtroppo non funziona.
l'evento onLoad, anche nel caso di mp3 in streaming, viene richiamato soltanto se il file è stato completamente scaricato.
nella parte commentata di codice infatti, il trace viene richiamato dopo che la riproduzione dell'audio è iniziata, quindi dopo che il buffer è stato caricato.
ho comunque risolto utilizzando la proprietà position della classe sound.
Codice PHP:
stop();
this.createEmptyMovieClip("music", this.getNextHighestDepth());
var bgSound:Sound = new Sound(music);
bgSound.loadSound("bgSound.mp3", true);
bgSound.setVolume(15);
/*bgSound.onLoad = function(success:Boolean) {
if (success) {
trace("go");
_root.gotoAndPlay(_currentframe+1);
}
};*/
bgSound.onSoundComplete = function():Void {
this.start(0);
};
this.onEnterFrame = function():Void {
if (bgSound.position>0) {
_root.gotoAndPlay(_currentframe+1);
delete this.onEnterFrame;
trace("iniziato");
}
};