Return visitors may note the appearance of an MP3 player at the bottom of the right-hand column. So, firstly: go put some music on! Mmmmm….
The impetus to make one of these now came out of my teaching, but it was one of those things I ‘d been promising myself to do for ages. Anyway, we’d been talking in class about interface objects that behaved in the same way that ‘real’ objects do—i.e. those that seem to obey the laws of physics—and I’d mentioned Joshua Davis‘ slider that you can ‘throw’ and that seems to ‘bounce off’ the end of its gutter. I went back and got the code walk-through from Davis’ excellent Flash To The Core book, and the basic interaction on my player ended up a version of that hacked to work vertically instead of horizontally. The rest of the code is pretty generic stuff…
The .fla (104kB) in MX2004 format is here. All Davis’ code has been updated for Actionscript 2.0 compliance. If you want to use it, all you have to do is:
- Number your mp3s sequentially by number (i.e. 01.mp3, 02.mp3, etc.). This means you don’t have to keep updating the button codes.
- Put them on your web space, ideally in a folder called “mp3s”.
- Put the relevant code pointing to these files into the buttons. All code is in the ‘Actions’ layer. Yes, it’s commented.
- Type the artist and song titles into the ‘content_mc’ movie clip.
Amazingly, the whole thing weighs in at a mere 12kB when embedded in a page. Sweet!