www.webdeveloper.com
Results 1 to 6 of 6

Thread: Help. Trying to get custom audio player to play .wav or mp3

  1. #1
    Join Date
    Feb 2007
    Posts
    43

    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.

    Thank you for your help
    Attached Files Attached Files

  2. #2
    Join Date
    Feb 2008
    Location
    NW Washington State
    Posts
    1,856
    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

  3. #3
    Join Date
    Aug 2008
    Posts
    17
    Here is a step by step guide tell you how to make a play button using AS

    http://www.******************.com/blog/?p=421

    hope it can help you

  4. #4
    Join Date
    Feb 2007
    Posts
    43

    The file as Flash 8

    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.

    Ultimately I want it to be a self-contained swf that looks and functions like the GE example from this web site: http://www.ge.com/news/audio_video/audio_podcast.html

    Thank you for teaching and contributing to this post.
    Attached Files Attached Files

  5. #5
    Join Date
    Nov 2008
    Posts
    203
    You helped me so much, i had the same problem. Now i m so glad to find its solution

  6. #6
    Join Date
    Feb 2008
    Location
    NW Washington State
    Posts
    1,856
    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

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles