Playing with AS3 – An example MP3 player component

I have finally gotten around to playing with AS3, and I decided to pick the Sound object as one to play with. In the end, I ended up creating a simple music playback “component” that uses a whole number of AS3 features. I am including the example here along with the source. Enjoy! Note: error handling is not yet very robust, but it still shows numerous aspects of AS3 in use. Requires Flash Player 9.

Grrrr… WordPress is munging the object and embed tags. The example can be seen here for the moment.

Another update: Did I mention error handling is not quite robust yet? Seems to not be loading anything over the server, however feel free to download the zip file and play with it locally.

Update 3: Seems it was just a case sensitivity issue on the file name, it’s up and running now.

Update 4: I have a new example up that adds some constructor options to some of the classes, and also adds a simple frequency spectrum display. Take a look and grab the updated source if you wish.

9 thoughts on “Playing with AS3 – An example MP3 player component

  1. “Grrrr… WordPress is munging the object and embed tags”

    Hello, my name is Jim and i have created plugin for WordPress
    that it allows to insert SWFs in your WodrPress Blog. This Plugin
    uses the SWFObject library. The use is very simple, this plugin
    simply encloses the Javascript and insert code for insert SWFObject.

    The form to insert SWF is:
    [swf] pathtofile.swf, width, height[/swf]

    You can see an explanation and example in:

  2. Awesome, thanks! I will check that out. I was initially trying to use SWFObject, but the script tag seemed to be getting munged by WordPress, too. This looks like it will fit the bill perfectly.

  3. this is exactly what i was looking for at the right time (educational as 3.0 example using music, and the wordpress flash plugin.

    much obliged.

  4. Hi.
    Can you tell me why you do not save references to the elements in a Display Object?
    (eg. Progressbar). Instead you always lookup up elements by getChildByName().

    I don’t wanna say its not good to do so… i’m just curious. memory concerns?

  5. Howdy, sorry missed your note. There is nothing wrong with doing that, I do it myself when I need to access something frequently. I just don’t like having too many handles hanging around.

  6. Hey Thank you for the component.

    But I have one problem when using the seek function in browser(ie7). sometimes it seems to stop when we seek beyond 50% and when we seek back it plays and the progress bar stops in the middle(the whole song is completed). do I have to do any thing to avoid this problem?.

Comments are closed.