7 Replies Latest reply on Jun 25, 2009 11:30 AM by kglad

    Sound problem

    smcaulif Level 1

      I've been using Flash for years and have never run across this until now. I know it's going to be something really stupid. Here's how to replicate:

       

      Flash CS4 - new fla file (as3)

       

      create 3 movie clips (mc1,mc2,mc3)

      import 3 sound files to library (snd1,snd2,snd3)

      within each movieclip - select the first keyframe on the clip's timeline and set it to play one of the sound files (sync -> "Stream")

       

      add 3 keyframes to the root timeline

      at each keyframe, place one of the movieclips

      add stop(); to these frames so the root timeline doesn't just play over and over again

       

      now add 3 buttons, and have each button do a gotoAndStop() to each of the 3 frames (so button 1 sends the timeline to frame 1, button 2 sends it to 2, etc.)

       

      WHen you test the movie - you'll be on frame 1 and the sound in the movieclip on the frame will be playing. If you select button3 and go to frame 3, the sound in the movieclip on frame 3 AND the previous frame's movieclip will play. (?!?!?!?!)

       

      No matter how many frames you have on the root timeline, if each has a mc with a sound inside it and you go from one frame to a later frame, like from 1 to 9 - the sounds in 2,3,4,5,6,7,8 and 9 all play at once.

       

      I've tried to use SoundMixer.stopAll() but to no avail. Does anyone know how to deal with this? THanks.

       

       

       

       

        • 1. Re: Sound problem
          kglad Adobe Community Professional & MVP

          when you add your keyframes to the root timeline, use insert blank keyframe so you don't add the movieclip(s) from the previous frame(s).

          • 2. Re: Sound problem
            smcaulif Level 1

            @kglad - good point but not it. There are 3 separate clips on 3 separate frames.

             

            To remedy the specific issue above I found that if I didn't have the sound play on the first frame of the movie clip in which it was embedded, but rather the second, it worked ok. Essentially, it's as if when the main timline went ahead a few frames, it cued all of the audio on the first frame of any movie clip on previous frames to play. Say that 5 times fast...

             

            If you nest each of the movie clips one more level deep - then it doesn't matter which frame you add the audio to, it will just trigger everything.

             

            Still feel I may be missing something, but for now it's more just a curiousity than a major problem.

             

             

             

            • 3. Re: Sound problem
              kglad Adobe Community Professional & MVP

              i don't see the problem.  i tested with two movieclips each with a streaming sound attached to their first frame.

              • 4. Re: Sound problem
                smcaulif Level 1

                @kglad - Try 3 (as I did in the above example). It's all about skipping over frame. If you go from one frame to the next it's fine. Add a third and go from 1 to 3 and tell me what happens (if you have time )

                • 5. Re: Sound problem
                  wadahell

                  SHUT UP!

                   

                  Date: Thu, 25 Jun 2009 10:51:41 -0600

                  From: forums@adobe.com

                  To: wadahell2007@hotmail.co.uk

                  Subject: Re: Sound problem

                   

                   

                  i don't see the problem.  i tested with two movieclips each with a streaming sound attached to their first frame.

                  >

                  • 6. Re: Sound problem
                    smcaulif Level 1

                    Wow. Will do.

                    • 7. Re: Sound problem
                      kglad Adobe Community Professional & MVP

                      what a mess.

                       

                      to remedy:

                       

                      label 3 frames.  on the frames after the labels place your movieclips and attach a stop().

                       

                      then use something like the following in your listener function:

                       

                      function f(e:Event){
                         
                          gotoAndPlay("third_label");
                          SoundMixer.stopAll();
                          gotoAndPlay("third_label");
                         
                      }