8 Replies Latest reply on Aug 24, 2006 1:47 PM by bergie3000

    How Exactly Are Scenes Combined in a SWF?

      I've read that when a Flash movie is broken up into
      scenes, upon publishing the scenes are just combined
      into one long timeline. That's fine, but something strange
      seems to happen with 'stream' audio.

      I have a voice-over track in each of my scenes set to 'stream'.
      Each scene stops in the last frame, then does a check
      to see if it should proceed to the next scene. There are
      at least five blank frames before the audio starts in each
      scene, yet somehow a little bit of audio from the next scene
      'bleeds' into the previous scene before previous scene stops.
      So a split second of the audio from the second scene can
      be heard at the end of the first scene, then the second scene
      audio starts again. It makes for a little 'stutter' or 'hiccup'
      in the audio.

      I've tried every trick I can think of to prevent the stutter
      including a stopAllSounds() command and putting the
      audio into its own movie clip, but nothing works.

      Is there something special about stream audio from
      scene to scene that causes it to move up a few frames
      when the SWF is published?
        • 1. Re: How Exactly Are Scenes Combined in a SWF?
          Level 7
          There are no scene in the final SWF file .. its just one continuous timeline
          with the scenes joined end-to-end. Similarly and soundtrack(s) in the
          scene(s) always get combined into one single soundtrack for the combined
          timeline. Soundtracks in clips are not affected by this, as they are
          independent timelines.

          You will get sound 'bleed' because there is buffering

          Putting each soundtrack in its own clip will work .. as each sound is
          separate and its not one big long soundtrack .. but then you lose streaming.

          You can also make your sound track as separate external MP3 and play then
          via script .. I'm not sure how that goes with syncing though.

          • 2. Re: How Exactly Are Scenes Combined in a SWF?
            bergie3000 Level 1
            Thank you very much for your reply. I have posted this question to
            user forums before and never received a reply.

            Can you explain in more detail what happens during 'buffering'?

            I have tried putting the sounds in their own movie clips but the
            loss of streaming is not acceptable for the project I am working on.

            I have also tried placing 'empty' sounds between my scenes but
            apparently the buffering clobbers them too.

            Thanks again.
            • 3. Re: How Exactly Are Scenes Combined in a SWF?
              Nickels55 Level 2
              Did you try adding blank keyframes on the sound layer at the end and beginning of each scene? Sometimes you may need to add more then one blank keyframe to get it to work.
              • 4. Re: How Exactly Are Scenes Combined in a SWF?
                bergie3000 Level 1
                Yes I have tried adding blank keyframes at the beginning and end of each scene. That sometimes works, but not always, and I would still like to understand what is happening behind the scenes. For instance, is there a way to determine exactly how many frames to add to ensure the sound will never 'bleed' through?
                • 5. Re: How Exactly Are Scenes Combined in a SWF?
                  Nickels55 Level 2
                  If you wanna see it behind the scenes then post the swf file. I will decompile it and save the new fla file out. Then I will publish it so you can open it the new fla file that I created from the swf. That should give you one long timeline vs your original with many scenes. Not sure though, as I have never tried anything like this yet.
                  • 6. Re: How Exactly Are Scenes Combined in a SWF?
                    bergie3000 Level 1
                    That sounded like such a good suggestion I tried it myself. I created a sample file and verified that the sound stuttering occurred. Then I grabbed an evaluation copy of the Sothink SWF Decompiler and decompiled the SWF. My original sample file is very simply three scenes with five blank frames in each followed by an audio clip set to 'stream'. At the end of each of the first two scenes are two lines of code:
                    The final frame of the third scene has a 'stop()' command. See instructions at the end of the post for downloading the FLA files if you are interested.

                    The decompiler did indeed create one big scene, but it also combined the three sound clips I had used (one in each of three scenes) into one big stream sound. This is especially interesting because of the five blank frames in the audio layer at the beginning of each scene. The blank frames appear to have been completely ignored.

                    I don't know how well the decompiled file reflects what Flash does to a file divided into scenes. For one thing, the audio stutter no longer occurs in the decompiled (then recompiled) file.

                    For reference, I have posted the files to the following locations:
                    Original file divided into three scenes:
                    Decompiled and recompiled file (one scene):

                    Please Note: I have neglected to mention one very important
                    detail. If you play the 'stuttering' movie back on most modern machines
                    you probably won't notice the stutter. I need to make this work on a
                    Sun Microsystems SunBlade 100, however, and the movie stutters
                    every time on that machine. You may also notice the stutter on older,
                    slower PCs or Macs.

                    Thanks again for your time. FLA and SWF files can be downloaded
                    by just replacing the '.html' in the above to URLs with '.fla'.
                    • 7. Re: How Exactly Are Scenes Combined in a SWF?
                      respondplease Level 1
                      Hi flash_bergie,

                      Thanks for your explanation. I've tried to download the fla ( http://home.grooveeleven.com/stutter/scene_stream_test.fla) but the "Page cannot be found"

                      Let me know if I did something wrong!

                      • 8. Re: How Exactly Are Scenes Combined in a SWF?
                        bergie3000 Level 1
                        Sorry about that. I think if you try again it should work.