Flash XML Music Player in ActionScript 3

Okay, I realize I posted the ActionScript 2 version of this music player just yesterday, but I had a little bit of time on my hands, so I decided to go ahead and update it with ActionScript 3. You can view the new version here.

This movie requires Flash Player 8
And here are the files for download: jukebox.zip

Tags: , , , , ,


You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

AddThis Social Bookmark Button

20 Responses to “Flash XML Music Player in ActionScript 3”

  1. Thanks for creating this in AS3. I am sure it will be useful to a lot of people.

  2. […] example, file, Flash, jukebox, music player, Source, webdesign, xml Craig Campbell just posted a nice jukebox example with source file available, demonstrating how you can do it using xml and as3. No Comments […]

  3. Übersicht: Mit Flash erstellte MP3-Player für die eigene Website…

    Oftmals will man eine MP3-Datei oder ganze Songlisten in eine Website integrieren. Hier eine Übersicht über größtenteils kostenlose MP3-Player, die mit Flash oder Flex erstellt worden sind.

    Easylistener Flash Music Player
    Von Yahoo! kann man einen…

  4. Thanks for posting the source Craig! This will be great to learn a few things from :)

  5. […] Flash XML Music Player in ActionScript 3 […]

  6. Is there a way to set this so that it doesn’t automatically load all the songs when the player loads? It’s a huge drain on server resources to load megabytes worth of music that might not even get played each time a user visits me site.

  7. @Shan: Great question! This particular music player only loads one song at a time. The songs are pulled in externally using an XML file. The song then streams as it plays so the user doesn’t have to wait for the entire song to load before hearing it. The code for this is included in the jukebox.zip source file linked to above.

    I’ll be posting a tutorial for this in the near future in case the code in the file doesn’t make sense.

  8. Craig, I changed the xml file to point to my mp3 files and when I view the site, my songs play in slow mode (like slow motion). I change the xml to point to your 3 songs and it works just fine. Was wondering if you or anyone else had experienced this enigma.

    Robert

  9. Hello Craig, first of all thanks for this tutorial and files. I do have a problem though and hope you can kindly help me solve it. I get the following error message:
    ***************
    Error #2044: Unhandled ioError:. text=Error #2032: Stream Error. URL: jukebox.xml at jukebox_fla::MainTimeline/jukebox_fla::frame1()
    ******************

    The player is visible on the page and the player’s screen says “Loading…”
    Hope you can guide me to solving this issue. Thanks a lot mate and have a great week.

  10. @Rod Gibson thats a very simple error, for some reson the .xml file is not were it should be just make shure you didn’t rename it or put it some were else ans chek the sript to see if its pointing to it

  11. I’m heartbroken. This is precisely what I was looking for - and thank you for doing this, Craig - but it would seem that, ah, it’s a Mac .fla. And I’m on Windows. Anyone have any advice?

  12. Heh. Never mind. Operator error.

  13. Great little player — I’ve been struggling with only one little thing though! Once the list loads, how do I change the autoPlay to no! I’d like the it to be ready to go, but just not start playing automatically.

  14. Awesome post, thanks for the player

  15. I figured out how to load the player stopped on the first song. duh. well i’m learning…

    I just copied the code from the stop btn section and dropped it in up top after the load section:

    pos = sc.position;
    sc.stop();
    songPlaying = false;
    play_btn.addEventListener(MouseEvent.CLICK,playSong);

  16. Neil Perryman Says:

    I was wondering if anyone could help with this:

    If you have mp3s in this jukebox that are quite larger (say 3mb) and you decide to click next song before the mp3 has fully loaded the file still loads in the background. If you pressed next again all three files would be downloading. Is there a way to stop the first song from completing its loading when you press next?

  17. I love this player too! But, I am having one small problem. I have loaded it onto my site, and I click play. Everything will play fine. If I click FWD, it will skip to the next song just fine. But, when I click FWD to go to the third song, it won’t play. It will only play 2 files at the most before it stops playing. I have checked my XML file, and all of the code is correct. Any tips?

  18. Also, I am using this player as a separate movie on my SWF. It remains stationary on the bottom of the page, while the rest of the page is interactive. When the file opens up everything is fine. But, when I click a button (and change frames), the buttons and text get slightly distorted. It’s like they move slightly. Any idea why this is happening?

  19. Hi
    i was wondering is there a way to create the playlist from a radio station. something like a rss blog reader. so the xml is coming from the web?

    best regards

    ron

  20. Hi

    I found a bug. The volume and the pause/play not works correctly. For example turn down the volume to minimum, press pause then press play. Do u hear it?

    schwarz

Leave a Reply