PDA

View Full Version : sound methods


jamesmiller
02-18-2004, 12:32 PM
i got a question about playing songs on my website.
i have a song that the user can listen to if they want and i was
wondering if it would cause my page to load slower if i put the song in my library and use a play button to access it(cause on the net the page does seem to load slowly) is there a method that i can use where the song is just on my server space and it will load when they push play, actually i know there is but i don't know how to do it.directions to a good tute would be much
appreciated.thanks

Ruben
02-18-2004, 01:03 PM
I'm pretty sure there are more ways to achieve this, but here are 2 for starters:

1. Place the song on your domain instead of placing it in the movie and put this script on your button:

s = new Sound()
s.loadSound("music.mp3",true)//true is the parameter of the streaming-property
s.start(0,1)


2. I could try to explain everything and stuff, but I guess you'll be better of if you'd just check this tute out:
http://www.actionscript.org/tutorials/intermediate/Creating_preoloaders_for_the_attachSound_Method/index.shtml

Hope this helps you out - Ruben

EDIT: I almost forgot, put rule 1 and 2 of the script somewhere on the first frame of your movie or somewhere where you're sure it'll only load once. And leave rule 3 in the script you have on the play-button...