le code sur la 1er image du lecteur est :
-------------------------------------------------------------------------------------------
cxml.url = "playlist.xml";
function Song (titre, compositeur, fichier) {
this.titre = titre;
this.compositeur = compositeur;
this.fichier = fichier;
}
function Station (nom, arrSongs) {
this.nom = nom;
this.arrSongs = arrSongs;
}
function Radio (arrStations) {
this.arrStations = arrStations;
}
function traceRadio (objRadio) {
for (j=0; j<objRadio.arrStations.length; j++) {
traceStation(objRadio.arrStations[j]);
}
}
function traceStation (objStation) {
trace ("-----------------");
trace ("Genre : "+objStation.name);
for (i=0; i<objStation.arrSongs.length; i++) {
traceSong(objStation.arrSongs[i]);
}
}
function traceSong (objSong) {
trace ("Tire : "+objSong.titre);
trace ("Compositeur : "+objSong.compositeur);
trace ("Fichier MP3 : "+objSong.fichier);
trace ("**");
}
function loadStations() {
mcStations.removeAll();
for (var i = 0; i < objRadio.arrStations.length; i++) {
mcStations.addItem(objRadio.arrStations[i].name,i);
}
}
function radioPlay () {
trace (">>start");
traceSong(objRadio.arrStations[intStation].arrSongs[intSong]);
txtTitle = objRadio.arrStations[intStation].arrSongs[intSong].titre;
txtStation = objRadio.arrStations[intStation].nom;
txtComposer = objRadio.arrStations[intStation].arrSongs[intSong].compositeur;
if (!s) {
s = new Sound();
s.onSoundComplete = function () {
_root.radioNext();
}
}
var filename = objRadio.arrStations[intStation].arrSongs[intSong].fichier
s.loadSound(filename, true);
//s.setVolume(3);
s.start();
instStatus.posReset();
instStatus.gotoAndPlay(1);
mLoaded.paramTarget = "s";
mLoaded._visible = true;
mLoaded.gotoAndPlay(1);
}
function radioStop () {
trace (">>stop");
s.stop();
}
function radioNext () {
intSong++;
if (intSong>=objRadio.arrStations[intStation].arrSongs.length) {
intSong = 0;
}
radioPlay();
}
function radioPrevious () {
intSong--;
if (intSong<0) {
intSong = objRadio.arrStations[intStation].arrSongs.length-1;
}
radioPlay();
}
function stationNext () {
intStation++;
if (intStation>=objRadio.arrStations.length) {
intStation = 0;
}
intSong = 0;
radioPlay();
}
function stationPrevious () {
intStation--;
if (intStation<0) {
intStation = objRadio.arrStations.length-1;
}
intSong = 0;
radioPlay();
}
intStation = 0;
intSong = 0;
_root.newSongArray = new Array();
_root.newStationArray = new Array();
_root.objRadio = new Radio();
stop();
------------------------------------------------------------------------------------------
donc je dois remplacer tout les _roots par this ????