A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Flash MP3 Player help

  1. #1
    Junior Member
    Join Date
    Apr 2006

    Flash MP3 Player help

    I am trying to build a mp3 player in flash but im not sure how to embed the audio file in the script i would also like to have a progress bar that shows how much of the song has played and how much is remaining.
    please help

  2. #2
    FK's Geezer Mod Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Out In The Pasture
    Still, one of the best and easiest ways to do that is to make a new fla just for the sound and the progress bar. It runs smooth and it takes up less space on your server, and, it streams in on even the slowest Gerbil powered modems.

    Make a new fla. Import the sound file to the library. In layer 1, name the layer sound. Select frame 50 and hit the F5 key. Select frame 1 again and in properties, use the sound dropdown thing to insert the sound file from the library. Now you see a blue jagged line in the layer. Drag frame 50 to the right, til you find the end of the blue line and stop there.

    Now, click in the layer, then in the Sync dropdown in properties again, select Stream.

    Make another layer on top, call it actions. Insert a dummy sound object, so you can target it later with some sort of volume controller. Put this in frame 1;

    snd1 = new Sound(this);

    Make another layer, on the bottom. Build a little progress bar, as big as you want it, convert it to a movie clip. Then go to the transform panel and set the width to 1 percent. Go to the end of the sound file layer and select the last frame, but in the progress bar layer, hit F6, then set the width to 100% in the transform panel. Make a tween in that layer.

    In the last frame of the actions layer, select the frame and hit F6 and add a stop(); in the last frame.

    Now test it.

    Use loadMovie to load that sound swf into your main movie for the player.

Posting Permissions

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

Click Here to Expand Forum to Full Width

HTML5 Development Center