PDA

View Full Version : How to make Sound Behavior Loop ??


Zunskigraphics
04-04-2006, 12:09 AM
I added a "play sound" behavior to a button. only thing is it only plays once. how can I make that loop over and over.

here is an example:

http://www.zunskigraphics.com/KOR/index.html

also, the song there now is about 5 min. long, just to show the client. I intend to use a small sound loop; 20 or 30 sec. at the most, but need to figure out the "loop" part.

thanks for the help!!!!

- Lance

irf2k
04-09-2006, 12:50 PM
to loop indefinitely, the best way is to export your sound for actionscript (you can do this by right clicking on the sound in library during development, and click on "Linkage->Export for Actionscript"...then give it the ID of "mySoundID".

you can then use this code:

var my_sound:Sound = new Sound();
my_sound.attachSound("mySoundID");
my_sound.onSoundComplete = function {
my_sound.start();
};
my_sound.start();


should work fine