Codice PHP:
var mySound:Sound = new Sound();
mySound.loadSound("http://www.miosito.it/canzone.mp3", false);
_root.onEnterFrame = function() {
var downloaded = _root.mySound.getBytesLoaded();
var total = _root.mySound.getBytesTotal();
var perload = Math.round((downloaded/total)*100);
if (downloaded != total) {
_root.load_txt = "downloading song - " + perload + "%";
} else {
done = 1;
_root.load_txt = "";
delete this.onEnterFrame
}
}
// e su un movieClip l'azione:
onClipEvent(enterFrame){
if (_root.done == 1) {
_root.mySound.start();
}
}
Comunque mi pare che ci siano i gestori di eventi per il loading per l'oggetto Sound.