Help. Trying to get custom audio player to play .wav or mp3
I have wav files that Im trying to create a flash file (player) to play. Basically a very simple play button and progress bar. I can convert the files to mp3, but would prefer to keep it wav if possible. I am having trouble getting it to work. I have read several tutorials and somehow am missing something. The example player I am trying to create can be found at this link: http://www.ge.com/news/audio_video/audio_podcast.html
My .fla file is attached. I would like to use A2. I think I have something wrong with the sound object actionscript or the way I'm telling it to play the file from within the library. I do not want the wav file (or mp3) to loop.
Should not be a problem. I'm still on Flash 8 and could not open the file.. so can you save as an older version and I'll take a look.
The display part is all cosmetic anyway... your player can look like whatever you want, it's the ActionScript man!
EfV
Thank you. I created an alternative solution, but I would still really like to know how to create what I set out to make.
The requirements I am wanting to learn actionscript for are as follows:
A play button that plays the audio once. The progress bar shows progression and when the audio sound reaches the end it goes back to the beginning and allows you to push play to hear it a second time. The tab on the progress bar would also reset to the beginning when the audio finishes.
I didn't actually post the code in the open forum so anyway, here is the simplest code for getting a music file to play and to create a rewind a play button. The scrubber bar is a little more work so get this part down first.
Sorry it’s taken so long to get back to you, had some computer problems to deal with. OK, looks like you’ve got a little more work to do on your music player.
First, I didn’t get anything to play with the player… main problem, you will want to use loadSound instead of loadMovie. Here is a little bit of code that you can test in a new, blank .fla. Just change the path to find your music. Put one simple button on the stage with instance name “playover_btn”.
Code:
var jukebox = new Sound();
jukebox.loadSound("d01_15_09_Fourth_of_July.mp3", true);
// true is autoplay, false is paused
var currentPosition:Number = 0;
var paused:Boolean = false;
// set paused to opposite of load sound true/false //
function playover() {
jukebox.loadSound("d01_15_09_Fourth_of_July.mp3", true);
}
playover_btn.onRelease = playover;
Second, does your loading bar actually work? There are lots of way to create “loading” bars so maybe it works and I just didn’t figure yours out. Anyway, you will also need a scrub bar if you want to display how far along in the file the audio has played. This starts to get a little more complicated. Your best bet may be to work though a couple tutorials from: www.gotoandlearn.com
and www.flashkit.com
Also, mp3s will be a lot more user friendly (much smaller files), so you may want to convert them.
Hope this gets you headed in the right direction.
Best wishes,
EfV
Bookmarks