i bin workin on a streaming Mp3 Music Player for my website. its the first time i attemped real actionscripting for my music player, before i just had movieclips with imported sound. this time im trying to load MP3s from external source. i been lookin in books and sites to help with the code. i got it workin and it looks quite good, but i have a problem. when it loads you HAVE to press play button to start the music, i would prefer it to play as soon as it has loaded. and when the song has finished, it stops instead of automatically playing the next song. you HAVE to press skip button to play the next song.
so if anybody could help me to get this to:
play from start/loaded
play next track once song has finished.
it would be very much appreciated.
this is my code below.
this.onEnterFrame = function () {
sload = mySound.getBytesLoaded();
stotal = mySound.getBytesTotal();
percentload = (Math.round((sload/stotal) * 100)) + "%";
if (counter < 2) {
counter = counter + 1;
// txt file telling where the mp3s are and there names.
loadVariablesNum("tracks.txt", 0);
// character to split track
songtitle = musictitle.split(":");
count2 = 0;
songplaying = (count2+1) + " - " + songtitle[count2];
}
if (stopped!=true) {
mySoundDuration=Math.round(_root.mySound.duration/1000);
mySoundPosition=Math.round(_root.mySound.position/1000);
texttime = mySoundPosition;
timemin = 0;
if (texttime < 10) {
texttime = "0" + texttime;
}
while(texttime >= 60) {
texttime = texttime - 60;
timemin = timemin + 1;
if (texttime < 10) {
texttime = "0" + texttime;
}
}
}
timeformat = timemin + ":" + texttime;
//Rewind
if (REV==1 && mySoundPosition>0) {
_root.mySound.stop();
mySoundPosition=mySoundPosition-1;
_root.mySound.start(mySoundPosition,0);
}
revButton.onPress = function () {
REV=1;
mySoundPosition=Math.round(_root.mySound.position/1000);
//
}
revButton.onRelease = function () {
REV=0
}
//Fast Forward
if (FF==1 && mySound.position<mySound.duration) {
_root.mySound.stop();
mySoundPosition=mySoundPosition+1;
_root.mySound.start(mySoundPosition,0);
}
FFButton.onPress = function () {
FF=1;
mySoundPosition=Math.round(_root.mySound.position/1000);
}
FFButton.onRelease = function () {
FF=0
}
}
and heres a shot of my player

thanks in advance
Bear

New Topic/Question
Reply



MultiQuote



|