3 Replies Latest reply on Jul 2, 2010 6:06 PM by kglad

    Why would audio trigger if it's not even reached on the timeline?

    Laer2 Level 1

      I had a  timeline with 3 sound effects, back to back, with a this.stop(); at the  end of each one (...so there's three separate sections of a timeline,  with a label at the start of each).... and when I'd play it (from the  start, for example), it would play the first sound effect (as expected),  and stop before the second section (where the next sound effect was)...  yet the second sound effect would trigger!

       

      Even when watching it in 'Test Movie' mode, I'd see that it stopped before the next section, yet the second sound triggered (many frames before the stop command!

       

      I tried putting more space between the sections... and putting the samples on different layers... yet it ALWAYS triggered the second sample, even though the frame it started on was never close to being reached!

       

      I also tried setting the audio event type to different things (Event, Start, etc).

       

      Anyone have any theories?

        • 1. Re: Why would audio trigger if it's not even reached on the timeline?
          kglad Adobe Community Professional & MVP

          you shouldn't attach sounds to frames.  if you do, there are lots of ways to have problems.

           

          to start, the sound isn't really sync'd to the time line unless you set the sound's sync property to stream.

          • 2. Re: Why would audio trigger if it's not even reached on the timeline?
            Laer2 Level 1

            I tried a couple of different methods (movie clips, etc), but this was one of the ways that ended up actully working... well, except for that unexplainable triggering when it hasn't ever reached the frame.

             

            Sync isn't a huge issue here...I just need the sound to trigger, so that's why I did it the way I did.

             

            Ultimately, I got it to work... but I never understood why the second or third audio would trigger, even though the frames they were on were never reached.

             

            I know that it doesn't have absolute sync, but it's odd that the audio triggers when the first frame of it (or any of the frames after it) are reached...  Like having a audio clip on frame 100, and a stop() on frame 50, and playing from frame 1 forward, and it triggers... even though the timeline successfully stops at frame 50.

             

             

            Originally, I had a movie clip consisting of the video, the audio clip, and a code layer to stop it and have it load another page.  On the _root timeline, I'd have one of the frames at the end of the main section have a label (say, 'LoadPage'), a stop() code, and an instance of the movie clip mentioned in the previous sentence.  The theory was that if you send the timeline to that label, it would stop on that frame, but the movie clip that it is sitting on there would play (having an independent timeline).  Got weird things happening doing that, and variations of it... like the audio playing, but not the video, or the audio of all the similar movieclips (separate on the main timeline) playing, even though only one of the movie clips was playing.  Very odd...

             


            How would you do it?  Have the movie clip always on the stage, but have the first frame of that clip with a stop() so it doesn't play, and then do a movieclip.gotoAndPlay(2) when you want it to trigger?  That's pretty much what I did in the end.

            • 3. Re: Why would audio trigger if it's not even reached on the timeline?
              kglad Adobe Community Professional & MVP

              use the sound class to play sounds.  you have much more control over sounds if you use the sound class and related classes.