Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Streaming music

Status
Not open for further replies.

Gazzieh

IS-IT--Management
Dec 18, 2006
117
GB
Picture a website with a series of pictures. As you click on one picture any current music stops and the relevant music for that picture starts. That is the structure I am aiming for.

I have at present two pictures, I have defined an empty movie clip, given it a name (soundLoader) and then added the following line into the ActionScript section of each picture:

on (press)
{
stopAllSounds();
mysound = new Sound(soundLoader);
mysound.loadSound("[site URL]/[music folder]/[song filename]", true);
}

Now, sometimes this works and other times it does not. The files vary between 1.5Mb and 7.5Mb and so I thought it might have been that the page is waiting until it has fully loaded the files (all MP3 format) before playing, instead of streaming? But then why would it work more frequently with the larger file?

Okay, exhausted ideas. Can you help?
 
on (press)
{
stopAllSounds();
mysound = new Sound();
mysound.loadSound("[site URL]/[music folder]/[song filename]", true);
mysound.start();
}
 
DOH!

Thanks. In fact I'd replicated the code and was also only making changes to the irrelevant coding!

Did a little housekeeping and it's sorted. Only issue now is that the tracks are playing slightly slower than they should be. Might be down to the data rate.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top