2 Replies Latest reply on May 27, 2006 11:08 PM by Newsgroup_User

    Looping a dynamically loaded MP3

    jerza
      I have a sound effect of a train on a site. The clip is rather large so I thought I would just stream the MP3 file instead of embedding it in Flash. So this is what I used. trainSound is the name of the variable and train_02.mp3 is the file. I am using MX 2004. This actionScript is in the first frame and it works fine once. The volume goes down to 50% as well. It does not loop though. Help.

      trainSound = new Sound();
      trainSound.loadSound("train_02.mp3",true);
      trainSound.setVolume(50);
      trainSound.start(0, 99);
        • 1. Re: Looping a dynamically loaded MP3
          kglad Adobe Community Professional & MVP
          the loops parameter is ignored if you stream your sound.
          • 2. Re: Looping a dynamically loaded MP3
            Level 7
            "jerza" <webforumsuser@macromedia.com> wrote in message news:e5b7c7$jh4$1@forums.macromedia.com...
            >I have a sound effect of a train on a site. The clip is rather large so I
            > thought I would just stream the MP3 file instead of embedding it in Flash. So
            > this is what I used. trainSound is the name of the variable and train_02.mp3 is
            > the file. I am using MX 2004. This actionScript is in the first frame and it
            > works fine once. The volume goes down to 50% as well. It does not loop though.
            > Help.
            >
            > trainSound = new Sound();
            > trainSound.loadSound("train_02.mp3",true);
            > trainSound.setVolume(50);
            > trainSound.start(0, 99);



            snd = new Sound();
            snd.loadSound("train_02.mp3", true);
            snd.onSoundComplete = function() // make the streaming sound loop
            {
            // there will be a slight pause between loops
            snd.loadSound("train_02.mp3", true);
            }

            You won't need a start command because streaming sounds start playing on their own after 5 seconds of downloading.
            tralfaz