Gracias a quie se apiade
Código:
MaGuM stop(); var i = 1; var v = 40; var mp3s = 3; _root.miMp3 = new Sound(); _root.miMp3.loadSound("mp3/" + i + ".mp3", true); _root.miMp3.setVolume(v); _root.miMp3.onSoundComplete = function () { ++i; if (i > mp3s) { i = 1; } miMp3.loadSound("mp3/" + i + ".mp3", true); _root.vol.gotoAndStop(v); } ; miMp3.onLoad = function (success) { var __reg4 = this.position / 1000; var __reg3 = Math.floor(__reg4 / 60); var __reg2 = Math.floor(__reg4) % 60; if (__reg2 < 10) { __reg2 = "0" + __reg2; } if (__reg3 < 10) { time_txt.text = "0" + __reg3 + ":" + __reg2; return; } if (__reg3 >= 10) { time_txt.text = __reg3 + ":" + __reg2; } } ; setInterval(miMp3, "onLoad", 1000); onEnterFrame = function () { porcentaje_txt.text = Math.round(miMp3.getBytesLoaded() / miMp3.getBytesTotal() * 100) + "%"; if (Math.round(miMp3.getBytesLoaded() / miMp3.getBytesTotal() * 100) == 100) { porcentaje_txt.text = "streaming completo"; } } ; miMp3.onID3 = function () { ide_txt.text = miMp3.id3.artist + " - " + miMp3.id3.songname; } ; _root.vol_txt.text = "volumen a " + v + "%"; _root.stop_btn.onPress = function () { miMp3.stop(); miMp3.setVolume(v); } ; _root.play_btn.onPress = function () { miMp3.start(); miMp3.setVolume(v); } ; _root.prev_btn.onPress = function () { if (i > 1) { i = i - 1; miMp3.loadSound("mp3/" + i + ".mp3", true); miMp3.setVolume(v); return; } if (i <= 3) { i = 3; miMp3.loadSound("mp3/" + i + ".mp3", true); miMp3.setVolume(v); } } ; _root.sigu_btn.onPress = function () { if (i < 3) { i = i + 1; miMp3.loadSound("mp3/" + i + ".mp3", true); miMp3.setVolume(v); return; } if (i >= 3) { i = 1; miMp3.loadSound("mp3/" + i + ".mp3", true); miMp3.setVolume(v); } } ; _root.volMenos_btn.onPress = function () { if (v > 0) { v = v - 5; miMp3.setVolume(v); _root.vol.gotoAndStop(v); _root.vol_txt.text = "volumen a " + v + "%"; } } ; _root.volMas_btn.onPress = function () { if (v < 100) { v = v + 5; miMp3.setVolume(v); _root.vol.gotoAndStop(v); _root.vol_txt.text = "volumen a " + v + "%"; } } ;