El problema esta en que quiero que cuando un mp3 se termine de reproducir pase al siguiente mp3, y que también se seleccione el botón que corresponde a ese mp3.
este es el codigo que tengo:
Código ActionScript :
Boton_btn1.stop();
_root.onLoad = function(){
coolTune = new Sound (soundLoader);
coolTune.loadSound("track1.mp3", false);
}
//btn1
Boton_btn1.onRollOver = function () {
if (!this.selected) {
Boton_btn1.gotoAndPlay("over");
}
}
Boton_btn1.onRollOut = function () {
if (!this.selected) {
Boton_btn1.gotoAndStop("play");
}
}
Boton_btn1.onPress = function (){
if (estado == 0){
for (var i = 1; i < 13; i++) {
buttons = _root["Boton_btn" + i];
buttons.gotoAndStop ("play");
buttons.selected = false;
}
this.selected = true;
this.gotoAndStop("pause");
coolTune.loadSound("track1.mp3", true);
coolTune.start(pausa/1000);
estado = 1;
} else {
pausa = coolTune.position;
coolTune.stop();
estado = 0;
this.gotoAndStop("play");
}
}
//Btn2
Boton_btn2.stop();
Boton_btn2.onRollOver = function () {
if (!this.selected) {
Boton_btn2.gotoAndPlay("over");
}
}
Boton_btn2.onRollOut = function () {
if (!this.selected) {
Boton_btn2.gotoAndStop("play");
}
}
Boton_btn2.onPress = function (){
if (estado == 0){
coolTune.loadSound("track2.mp3", true);
coolTune.start(pausa/1000);
estado = 1;
for (var i = 1; i < 13; i++) {
buttons = _root["Boton_btn" + i];
buttons.gotoAndStop ("play");
buttons.selected = false;
}
this.selected = true;
this.gotoAndStop("pause");
} else {
pausa = coolTune.position;
coolTune.stop();
estado = 0;
this.gotoAndStop("play");
}
}
//Btn3
Boton_btn3.stop();
Boton_btn3.onRollOver = function () {
if (!this.selected) {
Boton_btn3.gotoAndPlay("over");
}
}
Boton_btn3.onRollOut = function () {
if (!this.selected) {
Boton_btn3.gotoAndStop("play");
}
}
Boton_btn3.onPress = function (){
if (estado == 0){
coolTune.loadSound("track3.mp3", true);
coolTune.start(pausa/1000);
estado = 1;
for (var i = 1; i < 13; i++) {
buttons = _root["Boton_btn" + i];
buttons.gotoAndStop ("play");
buttons.selected = false;
}
this.selected = true;
this.gotoAndStop("pause");
} else {
pausa = coolTune.position;
coolTune.stop();
estado = 0;
Boton_btn3.gotoAndStop("play");
}
}
se que es con la funcion onSoundComplete pero estoy enredado con la sintaxis si alguien me puede iluminar con este estare eternamente agradecido.
