If you are still scratching your head trying to grasp the concept and structure of Actionscript 3, then this tutorial will help you get your feet wet. This Flash tutorial is great for users looking to begin using sound with Actionscript 3.0. It touches on the basics of sound integration.
In an attempt to improve a tutorial where the topic of creating a simple MP3 player providing a starting point most while getting your feet wet with AS3. I’ve decided to mature this post by putting a little more thought and effort into creating a more feature rich player.
Introducing the Mini MP3 Player
Based on your feedback, I implemented many of the features that had been request over the last year. However, the usage of the player is still meant for simple music playback and control. The feature list goes as follows:
- Easily load a new sound at runtime using the load() method
- Autoplay your loaded sounds
- Enabled looping of your loaded sounds
- Rewind and fast forward your loaded sounds using the built-in rewind/fast forward simulator
- Control the volume with the integrated volume scrubber
- Slick UI designed by Ryan Butz that can easily be customized
- External access to sound navigation functionality like playing, stopping, rewinding, forwarding, etc.
[button style=”download” link=”http://dl.dropbox.com/u/272056/Downloads/FlashSpeaks/CasaLibFrameUtilDemo.zip” color=”silver”]Download[/button]
How to implement the Mini MP3 Player?
Once you’ve dragged out an instance of the Mini MP3 Player onto the Flash stage, give it a relevant instance name. Trigger open your Actions pane and paste the snippet below which highlights controlling it’s initial properties. To get you off the ground quicker, I’ve created a quick start Flash file giving you everything you need to experiment with this mini MP3 player.
Note: This simple music player was built to handle any one mp3 at a time.
This music player can easily be added to a personal site, blog, and even a MySpace page. Use this to get you started, then see where that will take you. Enjoy!
As you integrate this into your projects, I’d love to hear our feedback. However, like always, let’s keep it constructive.
The provided audio loop is a part of the Teru’s Keys Loop freebie pack. Like it? Download the whole pack.