A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Streaming mp3 help!

  1. #1
    Junior Member
    Join Date
    Oct 2003
    Posts
    3

    Streaming mp3 help!

    Hi all, I have a small problem I'm hoping someone can help me with. I have an mp3 player on a site which streams mp3s from the serve. When the site loads, the mp3 plays automatically, my problem is that when the song ends it won't go to the next track unless you click on the "next track" button manually. I would like to know what the command is to make it go to the next track automatically. The script i have now for the first track is as follows;

    s = new Sound();
    s.loadSound("http://www.mysite.com/music/MyTrack.mp3", true);
    currentTrack="My Track";
    stopped=false;
    paused=false;
    stop();

    I'm sure there's something that goes in there or somewhere on the timeline which can make it go on to the next track, anyone that can help I would really appreciate it.
    Thanks in advance.

  2. #2
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    Try an onSoundComplete handler function, to load up the next track.

  3. #3
    Gods cower, women quiver. Buckwheat469's Avatar
    Join Date
    Dec 2003
    Location
    Uranus
    Posts
    247
    oldnewbie's right, onSoundComplete is used to go to the next track, but you have to have all the tracks arranged in an array. When the song is completed you advance the array by 1 (musicarray++). Then you recall the function to load the music using the array variable instead of the song name [Music1.loadsound("musicarray", true);].

    The only problem with this is you should count how many song titles are in your array so that when the array reaches the end you can rewind your playlist to the beginning or else the playlist will end.

    I was also working on a way to rewind and fast-forward streaming music. It was very cool stuff, but it would only work on the first song... I think I just came up with an answer though.
    yup.

  4. #4
    Gods cower, women quiver. Buckwheat469's Avatar
    Join Date
    Dec 2003
    Location
    Uranus
    Posts
    247
    sorry, it's supposed to be loadSound(musicarray, true); forgot to erase the quotes.
    yup.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center