Algumas o nome da música aparecem, outras aparece undefined, pode ser a variavel.
Tem que rever a AS utilizada.
AN
Utilizei o seguindo AS:
stop();
//Criando objeto som_sound
var som_sound:Sound = new Sound();
var numero:Number = 1;
//Volume
var vol:Number = 100;
/*cria-se a função music com o parâmetro "musica" que indicará a música que será tocada pelo player.*/
function music(musica) {
//criando todas as variáveis necessárias
var pos, verifica;
/*a função "loadSound" carrega a mp3 no objeto "som_sound", com o caminhoespecificado no parâmetro "musica"; true informa que será carregado por streaming*/
som_sound.loadSound(musica, true);
som_sound.onSoundComplete = function() {
if (_root.numero<>17) {
_root.numero += 1;
musica = "musica"+numero+".mp3";
music(musica);
} else {
_root.numero = 1;
musica = "musica"+numero+".mp3";
music(musica);
}
};
_root.onEnterFrame = function()
{
//exibe o nome da música no campo musica_txt
artista_txt.text = som_sound.id3.artist;
musica_txt.text = som_sound.id3.songname;
album_txt.text = som_sound.id3.album;
som_sound.setVolume(vol);
};
// ações dos botões ===============
//pára a música
stop_btn.onRelease = function() {
som_sound.stop();
};
//pausa a música
pause_btn.onRelease = function() {
acao = "pause";
pos = som_sound.position/1000;
som_sound.stop();
};
//dá o play
play_btn.onRelease = function() {
if (acao == "pause") {
som_sound.start(pos, 1);
acao = "";
} else {
som_sound.start();
}
};
}
previous_btn.onRelease = function() {
if (_root.numero<>1) {
_root.numero -= 1;
musica = "musica"+numero+".mp3";
music(musica);
} else {
_root.numero = 17;
musica = "musica"+numero+".mp3";
music(musica);
}
};
next_btn.onRelease = function() {
if (_root.numero<>17) {
_root.numero += 1;
musica = "musica"+numero+".mp3";
music(musica);
} else {
_root.numero = 1;
musica = "musica"+numero+".mp3";
music(musica);
}
};
vol_less_btn.onRelease = function() {
if (vol>=10) {
vol -= 10;
trace(vol);
}
};
vol_more_btn.onRelease = function() {
if (vol<=90) {
vol += 10;
trace(vol);
}
};
//=========================
musica = "musica"+numero+".mp3";
music(musica);
link_btn.onRelease = function() {
getURL('http://www.barbozaneto.com.br' '_blank');
};
link2_btn.onRelease = function() {
getURL('http://www.salernopublicidade.com.br' '_blank');
};