1 Reply Latest reply on Jun 20, 2007 6:09 AM by MaxManNH

    Music Loop Help

    TRI0N
      Okay what I have here is a real simple and fast loading script to stream a .mp3 file for music throughout the entire site I've built. What I need to do is make this music loop (repeat continiously) unless Stop is pressed. The whole fla file consists of 1 Frame with 2 Layers.

      1) The action Scipt Below.
      2) The control buttons.

      Is there an easy addition to add to my script to allow the music to loop.. Music plays on load. If somone presses "Stop" it stops. If somone presses "Play" it will play again and loop.

      Action Script:
      var tune:Sound = new Sound();
      tune.loadSound("breathe2.mp3", true);
      tune.start();

      play_mc.onPress = function() {
      tune.stop();
      tune.start();
      }

      stop_mc.onPress = function() {
      tune.stop();
      }


      Thanks for any help on this.

      Cheers!

      TRI0N
        • 1. Re: Music Loop Help
          MaxManNH Level 2
          Doesn't the sound object allow you to declare the number of times the music playing loops?

          tune.start(secondsOffset, loops);

          Just give it a number that will likely never roll over like 100000

          tune.start(0, 10000);

          If your site music is say one minute in length then thats 10000 minutes of play time.