Groups | Blog | Home
all groups > flash actionscript > april 2004 >

flash actionscript : preloading streaming mp3


jdudan
4/5/2004 9:44:07 PM
Hello.

I have an mp3 player as its own .swf. It streams a song using the loadSound
script with a true value for streaming. My play and pause btns work fine and
the song starts playing anywhere from 1-8 seconds on a broadband connection.

My question is this...

I would like the song to start playing exactly when the other movie is done
loading on a different level. For an example of this, go to
http://www.therapyproductions.com/flashindex.html.

I can set the value of the loadSound to false, but that would load the whole
sound before playing (the file is about 4 MB I think).

Any help would be wonderful. Thanks.
Jack.
4/5/2004 10:55:01 PM
immediately after the loadSound(url,true)
use mySound.stop(); to hold the playback,
use a loop to monitor the _currentframe /_totalframes
properties of the other movie to determine its position,
( or set a Boolean variable on the last frame )
when (_currentframe==_totalframes), or
(variable==true), use mySound.start();

not tested prior to posting, so good luck :)
for more on the Sound object, visit -
http://www.kennybellew.com/tutorial/

jdudan
4/5/2004 11:10:00 PM
Jack-
Thanks for your reply, but how do I use a loop to monitor the _currentframe
/_totalframes
properties of the other movie to determine its position? I read the tutorial
you gave me, but that didin't have anything on my problem. Thanks.

Jesse
Jack.
4/5/2004 11:36:27 PM
[quoted text, click to view]

after a re-read :) if you want the sound to start when the movie has
completed loading, use a preloader to detect the loaded and total
byte count of the loading movie and fire the sound.start(); on its
completion.
the kenny bellew link has -How to Build a Preloader for Dynamically
Loaded MP3's, i'm sure it could be modified to load your 'other movie '
AddThis Social Bookmark Button