PDA

View Full Version : MP3 Player AS2.0 Class - XML Playlist and Skin



pyrophone
August 21st, 2006, 09:30 PM
Here is an MP3 Player AS2.0 class I made. The idea was to make it very easy to implement in flash, and then to allow the skin and playlists to be editable via XML. Compatible with Flash Player 7 and up.

Critique it, use it, add to it. If you make improvements, please post them here for everyone to use! Feel free to post links to your implementations of the player as well (assuming anyone decides to use it!).

Demo and MX2004 Source - version 1.2 (http://www.pyrophone.com/mp3player/)

(By the way - the demo skins could be a lot better. Just putting something up there to show.)

**EDIT** 10-27-2006

Version 1.2 - Fixed bug introduced in 1.1: Playhead was not being triggered by play/pause button.

Version 1.1 - Fixes small bug: Player would not automatically go to next track if playOnLaunch was set to "true".

-- Jon

chrisclick
August 22nd, 2006, 02:57 PM
Pretty sweet stuff you got there! I like it.

brianmanden
August 23rd, 2006, 06:13 AM
Woouww very nice !!! :thumb:

tonygarcia
August 24th, 2006, 01:33 PM
this is only missing the 'album art'

pyrophone
August 24th, 2006, 01:43 PM
this is only missing the 'album art'

I built it mainly with integration into websites in mind -- in other words a pretty small physical footprint -- and album art didn't fit into that concept very well.

You could also say it is missing graphic EQ, but again, didn't need it, so didn't build it.

That said, feel free to post any mods or additions! If you want album art or graphic EQ, feel free to add it. (Just name your class something different to avoid confusion!) :beer:

mariachi
September 4th, 2006, 11:53 AM
pyrophone, that's a very nice player, clean and practical...
thank you, i'll play with it.

pares101
September 6th, 2006, 03:19 AM
how can i make it where the song AUTOMATICALLY plays when its first starts up?

pyrophone
September 6th, 2006, 09:12 AM
how can i make it where the song AUTOMATICALLY plays when its first starts up?
In your settings XML file, set playTrackOnLaunch = "true"

There are a lot of settings in the settings XML file, so read through them carefully - you can choose which controls to use as well, so that in theory you could make a tiny player with only a play/pause and stop button.

pares101
September 6th, 2006, 11:19 AM
yeah i just did that i guess i overlooked that part! this player rocks! :)

Sinister Rouge
September 6th, 2006, 11:23 AM
nicely done, i like it a lot... keep up the good work. i would love to see more of stuff like this on the kirupa forums. maybe a whole section dedicated to classes and such made by the community like at the forums on gotoandlearn.com. More than just source/experiments, a section dedicated to reusable classes and handy tid bits of information.

pares101
September 6th, 2006, 11:53 AM
an off question from the player :) How do i make it where when a roll over plays that it plays the whole thing even when the person rolls out and goes onto another button than that button starts and vice versa...

pyrophone
September 6th, 2006, 02:19 PM
an off question from the player :) How do i make it where when a roll over plays that it plays the whole thing even when the person rolls out and goes onto another button than that button starts and vice versa...
That would be tricky with this player - not necessarily impossible, but the way the buttons are set up is really not for animated swfs. They are set up more like css rollovers are in html to make it simple to skin the player images: 1 "up" button image and 1 "over" button image. I used 1-frame swfs in my example for their alpha capability, but animated swfs would be hard to control. By the way, you can use jpgs as well as swfs.

pyrophone
September 6th, 2006, 02:22 PM
nicely done, i like it a lot... keep up the good work. i would love to see more of stuff like this on the kirupa forums. maybe a whole section dedicated to classes and such made by the community like at the forums on gotoandlearn.com. More than just source/experiments, a section dedicated to reusable classes and handy tid bits of information.

A good idea...

Glad you like the player!

pares101
October 25th, 2006, 02:41 AM
How do i make the player play the next song when the 1st one is done?

pyrophone
October 25th, 2006, 10:05 AM
How do i make the player play the next song when the 1st one is done?

The player does this automatically. If you are having trouble with it, can you show me a link to your player and xml files.

pares101
October 25th, 2006, 12:12 PM
www.carlosbertonatti.com/carlos

pyrophone
October 25th, 2006, 06:19 PM
www.carlosbertonatti.com/carlos (http://www.carlosbertonatti.com/carlos)

I'll need to see your xml files too...

pares101
October 25th, 2006, 08:20 PM
they are www.carlosbertonatti.com/carlos/settings_1.xml
www.carlosbertonatti.com/carlos/settings_2.xml
www.carlosbertonatti.com/carlos/library.xml

pyrophone
October 26th, 2006, 10:51 AM
pares101: Thanks - you found a bug in my code. It is fixed now - please download version 1.1 of the class. Just replace the original MP3Player.as with the new one and republish your flash file. Let me know it goes!

Link to version 1.1 in first post of this thread (http://www.kirupa.com/forum/showthread.php?t=231650)

pares101
October 26th, 2006, 01:49 PM
yay i bug tested woohoo!!!

pyrophone
October 27th, 2006, 11:41 AM
Version 1.2 fixes a bug introduced in 1.1. Aaargh.

Link to version 1.2 in first post of this thread. (http://www.kirupa.com/forum/showthread.php?t=231650)

I would love to have some other people do some bug testing. Any takers?