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

flash actionscript : preloader for streaming audio



dergarten
5/25/2004 9:28:32 PM
I have tried several ways... Failed... My problem is that I was using the
progress bar component with a loader loading the mp3. However, the progress bar
works the first time but when returning to that frame from another frame, the
sound loads againg but the progress bar stops working.

So I have tried to use the loadSound method, creating a movie that displays
"loading song" and another movie that would cover up "loading song" when the
stream starts playing. I'm not big on coding so here is what I came up with:

mySound_sound = new Sound();
mySound_sound.loadSound("fallen.mp3", true);
fallen.mp3.onLoad = function(){
this.fallencover.gotoAndPlay("2");
}

the idea was that the movie fallencover plays at frame 2 when the stream sarts
playing, covering the "loading song" movie.

Is this even possible? Possibly...

Any suggestions? Basically, all I want is an indication that the song is
loading while people are waiting

Thanks!

Steeve

Link:

go to: http://homepage.mac.com/gartenmuzik

then click on the first link under clients (the garden)

once the site is loaded, click on the top left square (audio)

then click on fallen
Jack.
5/26/2004 12:04:16 AM
use position - Property (read-only);
returns the number of milliseconds a sound has been playing.

mySound_sound = new Sound();
mySound_sound.loadSound("fallen.mp3", true);

this.onEnterFrame = function(){
if(mySound_sound.position > 0){
fallencover.gotoAndPlay(2); // frame2
delete this.onEnterFrame;
}
};

you had fallencover.gotoAndPlay("2");
this will look for frame label "2"
it is not recommended to use numbers as frame labels

hth


AddThis Social Bookmark Button