This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > Flash Site Design > April 2004 > Handling the LoadSound delay for Streaming MP3





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Handling the LoadSound delay for Streaming MP3
somatique

2004-04-21, 3:16 pm

Hey :)

I have a music picker on a site i'm working on -
http://somersethouseinn.com/2004

You'll see [1] [2] [3] under the heading "tunes". I'm streaming 3 different
mp3s off the server. Problem is that they take a few to start playing, and i'm
concerned users will just keep clicking on the button, causing the stream to
start over and over again. I'd like to have some sort of loading animation that
temporarily disables the button so they can't keep clicking on it until the
stream starts to play. Here's the script that is controling the button right
now.

on (release) {
stopAllSounds();
mySound = new Sound();
mySound.loadSound( "http://www.somersethouseinn.com/mp3/1.mp3", true);
mySound.play();
}

adireddy

2004-04-22, 4:30 am

You can also disable the play button once it is clicked....

playbuttoninstance.enabled = false;

and you can enable it again when the song gets loaded or at the end of the
song.

mySound.onLoad = function(success){
playbuttoninstance.enabled = true;
}

or

mySound.onSoundComplete = function(success){
playbuttoninstance.enabled = true;
}


somatique

2004-04-22, 5:33 pm

awesome! Thank yo so much!!!
kinglai

2004-04-24, 5:30 pm

I have tried to use the samescript for flash5, but fail...
is it because flash5 didn't have "loadsound" function?
thank you very much
Sponsored Links


Copyright 2003 - 2008 forum4designers.com  Software forum  Computer Hardware reviews