Skip navigation
Currently Being Moderated

Sounds from previous frames continue playing

May 26, 2012 6:26 PM

Hi,

when have a frame with MovieClip and inside is another MovieClip with a sound (2-frame animation so I can hear it is looping), it will continue looping also on all next frames - the sound is still here.

It also loops if I don't go to this frame and use gotoAndStop to jump directly to any of the following frames.

You can download zipped example here: https://docs.google.com/open?id=0B_aeMwO9RVB2Z3daT2hwR2hvSXM

 

Please can anyone explain me why does it happen? Is it a bug?

 

Thanks!

 
Replies
  • kglad
    72,189 posts
    Jul 21, 2002
    Currently Being Moderated
    May 27, 2012 7:11 AM   in reply to jendabek

    it's not likely anyone will download and work on your files and it's not likely you've encountered a flash bug.

     

    there are so many ways to cause the problem you describe (a sound playing when you think it should not), you can't be helped without some specifics of your situation.  to start, as2 or as3?  sound attached to a timeline or instantiated with code? 

     

    why do you think your sound should not continue to play if it is attached to a looping timeline?

     
    |
    Mark as:
  • kglad
    72,189 posts
    Jul 21, 2002
    Currently Being Moderated
    May 27, 2012 12:50 PM   in reply to jendabek

    It's AS3. I use the most basic document class in the example with simple gotoAndStop.

    In the FLA I have one layer with two keyframes - in the first one there is a MoviClip that contains another MC that contains 2-frame anim with sound. The second keyframe is blank, only txt to see I am on this frame.

     

    what second keyrame?  the 2nd main timeline keyframe or MC's 2nd frame?

     

    The problem is that when I gotoAndStop to any frame that lies after the keyframe with Movieclip (that contains anim with sound) I can hear this sound even I have never been on this frame.


    what makes you think you never play the frame with the sound?  have you attached a trace() to that frame?
     
    |
    Mark as:
  • Currently Being Moderated
    May 29, 2012 10:27 AM   in reply to jendabek

    Click in the frame that has audio. Open the properties panel and check the Sync drop-down. It is set to Event by default. Change it to stream. Now make sure the frame that has the audio has enough frames to play the full audio.

     

    By using Sync:Event you are asking flash to play the audio in the frame regardless if it's in that frame or not. Stream only plays if the playhead is currently playing that clip. The second the playhead is outside the clip, when set to stream, it will stop playing.

     

    So in your screenshot, after you set Sync:Stream you will need to add frames (F5) to the layer that contains the audio (you can see the waveform). If you don't you'll only hear however many frames of audio you extend.

     
    |
    Mark as:
  • Currently Being Moderated
    May 30, 2012 10:37 AM   in reply to jendabek

    Somewhat strange behavior but you should put a stop() on the first frame of the clip that contains the audio. Otherwise it's going to bounce back and forth between frame 1 and 2 unless you explicitly tell it to stop elsewhere.

     

    You're jumping to frame 10 so that should put you past the clip and you're telling it to stop on 10 so it should never load that clip, animation or sound. Best thing to do is add a new layer in there and add some trace statements so you can see if something else is affecting the clip that you might not be thinking of.

     

    On frame 1 I'd do:

     

    trace("Frame 1");

     

    On frame 10 I'd do:

     

    trace("Frame 10");

     

    On frame 4 where that clip starts I'd put:

     

    trace("Frame 4");

     

    Chances are you'll see the traces happen even though you don't expect it. Something you're not thinking of is probably affecting that timeline.

     
    |
    Mark as:
  • Currently Being Moderated
    May 30, 2012 3:56 PM   in reply to jendabek

    Glad you got it fixed. Good luck!

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points