1 pièce(s) jointe(s)
[AS/Xml] Flux radio/datas
Bonjour à tous;
voici mon problème:
j'ai 2 types de flux :
-"musique" (radio) -> ex: http://stream.musicmatic.com:8000/hit1
-"data" (xml) -> ex: http://traxx.musicmatic.com/?channel=hit1
je voudrais simplement permettre d'ecouter la musique en cliquant sur un des boutons et faire afficher le contenu (artist + year)
L'ensemble fonctionne paradoxalement en local 8O (je veux dire, quand je test "ctrl+enter" le player fonctionne avec affichage du contenu, mais onlin, dc sur un serveur, ca passe pas dc.. perso, je n'y comprends plus rien.
voici l'url du player : http://www.3-14.net/datas/audio.html
voici le code + le fla:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
| var my_sound:Sound = new Sound();
var output_xml = new XML();
output_xml.ignoreWhite = true;
output_xml.onLoad = function(success){
if (success){
var artist_name = this.firstChild.childNodes[0];
var namearea = artist_name.firstChild;
var year = this.firstChild.childNodes[1];
var yeararea = year.firstChild;
output_txt1.htmlText = yeararea.nodeValue;
output_txt0.htmlText = namearea.nodeValue;
}
else output_txt.text = "Error loading XML";
}
function changesound(select,datas){
my_sound.loadSound(select,true);
output_txt0.text = "Loading...";
output_txt1.text = "Loading...";
output_xml.load(datas);
}
but1.onRelease=function(){
changesound("http://stream.musicmatic.com:8000/hit1","http://traxx.musicmatic.com/?channel=hit1");
}
but2.onRelease=function(){
changesound("http://stream.musicmatic.com:8000/hit2","http://traxx.musicmatic.com/?channel=hit2");
}
but3.onRelease=function(){
changesound("http://stream.musicmatic.com:8000/poprock","http://traxx.musicmatic.com/?channel=poprock");
} |
Dans l'attente de vous lire.