Hola! Tengo un componente de flash para reproducir mp3, pero necesito que haga autoplay (pide presionar play cuando carga) y que cuando termine una cancion siga con la otra y asi sucesivamente hasta que cuando llegue a la ultima vuelva a la primera.
Buscando encontre en este foro una respuesta
http://www.forosdelweb.com/f16/miren...codigo-148338/, pero no me funciona...
La verdad se muy poco sobre AS, quizas esté haciendo algo mal...
Les dejo el codigo:
Código:
AudioXml = new XML();
AudioXml.ignoreWhite = true;
AudioXml.onLoad = LoadXmlFile;
AudioXml.load(playListPath);
function LoadXmlFile(success) {
if (success) {
aPath = new Array();
asongTitle = new Array();
aAudio = new Array();
aAudio = this.firstChild.childNodes;
AudioTotal = aAudio.length;
for (i=0; i<AudioTotal; i++) {
if (aAudio[i].nodeName == "AudioProps") {
aPath.push(aAudio[i].attributes.path);
asongTitle.push(aAudio[i].attributes.songTitle);
}
}
AudioPath = aPath[0];
tAuthor = asongTitle[0];
AudioActual = 1;
tCount = AudioActual+" Of "+AudioTotal;
tText = "Reproductor";
} else {
tText = "No se puede cargar sonidos";
}
}
Ff.onPress = function() {
if (AudioActual<AudioTotal) {
AudioActual += 1;
AudioPath = aPath[AudioActual-1];
tAuthor = asongTitle[AudioActual-1];
MySound.stop();
Mystatus = "Presione Play";
}
};
Rw.onPress = function() {
if (AudioActual>1) {
AudioActual -= 1;
AudioPath = aPath[AudioActual-1];
tAuthor = aSongTitle[AudioActual-1];
MySound.stop();
Mystatus = "Press Play";
}
};
PlayBtn.onPress = function() {
if (FlagPausa == true) {
MySound.start(SoundPausePos, 0);
FlagPausa = false;
SoundPausePos = undefined;
} else {
MySound = new Sound();
volume = 100;
MySound.setVolume(volume);
MySound.loadSound(AudioPath, StreamFlag);
FlagPausa = false;
_parent.onEnterFrame = function() {
TB = MySound.getBytesTotal();
BL = MySound.getBytesLoaded();
if (BL != TB) {
TheText2.text = Math.round((BL/TB)*100)+"% Cargando";
} else {
TheText2.text = "Tema Cargado";
delete _parent.onEnterFrame;
MySound.start();
}
};
}
};
StopBtn.onPress = function() {
MySound.stop();
Mystatus = "Precione Play";
};
PauseBtn.onPress = function() {
SoundPausePos = MySound.position/1000;
MySound.stop();
FlagPausa = true;
};
volUp.onPress = function() {
if (volume == 100) {
volume = 100;
} else {
volume += 10;
MySound.setVolume(volume);
}
};
volDown.onPress = function() {
if (volume == 0) {
volume = 0;
} else {
volume -= 10;
MySound.setVolume(volume);
}
};
Gracias