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: actionscript 3, Flash, jukebox, music player, playlist, XML
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.




March 23rd, 2008 at 6:10 am
Thanks for creating this in AS3. I am sure it will be useful to a lot of people.
March 24th, 2008 at 4:57 pm
[…] 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 […]
March 24th, 2008 at 6:03 pm
Ü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…
March 26th, 2008 at 10:38 pm
Thanks for posting the source Craig! This will be great to learn a few things from
March 29th, 2008 at 9:54 pm
[…] Flash XML Music Player in ActionScript 3 […]
March 31st, 2008 at 7:57 am
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.
March 31st, 2008 at 8:13 am
@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.
April 3rd, 2008 at 11:46 am
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
April 22nd, 2008 at 9:44 pm
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.
April 26th, 2008 at 9:58 pm
@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
April 28th, 2008 at 3:42 pm
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?
April 28th, 2008 at 4:10 pm
Heh. Never mind. Operator error.
May 3rd, 2008 at 2:33 pm
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.
May 5th, 2008 at 10:35 am
Awesome post, thanks for the player
May 8th, 2008 at 5:48 pm
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);
May 13th, 2008 at 10:06 am
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?
May 29th, 2008 at 2:39 pm
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?
May 30th, 2008 at 12:23 pm
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?
July 15th, 2008 at 12:48 pm
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