Question
Music Looping
I've added some background music to my site with a start/stop
button. I'd really like the music to loop. I found another post on
how to do this but the script isn't working for me... Here is what
I have:
var amb:Sound = new Sound();
amb.loadSound("music/IntroAmb1.mp3", true);
amb.start(0, 1000);
play_btn.onPress = function() {
amb.stop();
amb.start(0, 1000);
}
stop_btn.onPress = function() {
amb.stop();
}
As I understand it, the sound object allows me to declare how many times my music loops with:
amb.start(secondsOffset, loops);
As you can see I've set the loop number to 1000, but it doesn't repeat. Can anyone tell me what's wrong? Thank you!!
var amb:Sound = new Sound();
amb.loadSound("music/IntroAmb1.mp3", true);
amb.start(0, 1000);
play_btn.onPress = function() {
amb.stop();
amb.start(0, 1000);
}
stop_btn.onPress = function() {
amb.stop();
}
As I understand it, the sound object allows me to declare how many times my music loops with:
amb.start(secondsOffset, loops);
As you can see I've set the loop number to 1000, but it doesn't repeat. Can anyone tell me what's wrong? Thank you!!