Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Loop music via Action Script.?

New Here ,
Dec 16, 2008 Dec 16, 2008
Hi, I added a song to flash, and did it all in action script. The music will play right off the bat, and I can mute it by clicked on the mute button that I have made. But after the song goes all the way through,... thats it... It will not loop. And I cannot find out how to make it loop. Remember, the button I made is not to stop the music, just to mute it and unmute it. The functions I used is:

var sound = 1;
var sound_mc = _root.attachMovie("sound_off","sound01",99);
sound01._visible = false;
sound_mc._y = btn._y;
sound_mc._x = btn._x;
var s:Sound = new Sound();
s.attachSound("Cedarland music");
s.start(0);
btn.onPress = function(){
if(sound==1){
s.setVolume(0);
sound01._visible = true;
sound = 0;
}
else if(sound==0){
sound = 1;
sound01._visible = false;
s.setVolume(70);
}
}



Please let me know what I am missing.. It might be an easy thing, but I cannot figure it out.
TOPICS
ActionScript
555
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 16, 2008 Dec 16, 2008
in your sound's (s) start() method you can use a 2nd parameter to indicate the number of loops you want:

s.start(0,100); // 100 loops.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 17, 2008 Dec 17, 2008
YES! thank you very much. I knew it was a easy thing that I was missing,.. I didnt expect it to be that easy though. Thank you very much!
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 17, 2008 Dec 17, 2008
LATEST
you're welcome.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines