4 Replies Latest reply on May 30, 2006 9:13 AM by Mr.Lemur

    preloader snag

      total noob here...

      I'm trying to create a preloader animation by having the movie loop on the first two frames until getBytesLoaded() == getBytesTotal(). The problem is I have a very large sound file that's linked to "Export for Actionscript". Now by default the the "Export in First Frame" option is checked and, as I understand it, this will prevent my two-framed loader animation from showing, because the first frame doesn't start until AFTER the sounds are loaded.

      The problem is, if I uncheck the "Export in First Frame" option, my sounds disappear completely and don't get compiled with the .swf file... why is that?

      I know this is just a stupid newbie thing and the answer is probably very simple, but it's driving me crazy and any help would be greatly appreciated.

        • 1. Re: preloader snag
          yachts99-2vTvY1 Level 2
          You need to specify a new frame to export you sound in. As you have unchecked the "Export in First Frame" option your sound is now not being exported at all. Go to File ->Publish Settings -> Flash (tab) -> Settings (button) and set the frame to export your sound. I would suggest frame 3 as you have a two frame loader.
          • 2. Re: preloader snag
            hogsmeade Level 1
            thanks for the reply yachts99.

            The closest thing I can find under publish settings > flash > settings button that sounds like what you're saying is an option that says "Export frame for classes", nothing about sounds. I tried setting that one to 3 but it still forgets to load my sounds.

            Forgot to mention that I'm using Flash 8, if that makes a difference.

            I've found that if I drag the sounds onto the stage in some keyframe after the rest of my frames it will load the sounds and still play my animation. I'm glad that works, but it seems sloppy to me. Fortunately I only have a few sounds for this app, but eventually I expect to be creating apps with a lot of sound files. I develop games with Director and I've been thinking of switching to flash, but if this sound thing is going to be a problem then I'm going to have to think twice (games generally have a lot of sounds files).

            If anyone can show me an easier way I would be very grateful.

            • 3. Re: preloader snag
              yachts99-2vTvY1 Level 2
              "Export frame for classes" is the right place to specify a different frame to export your symbols if you have unchecked "Export in First Frame". So you were in the right place! However, now I think about it a bit more, perhaps try exporting on frame 2 instead of 3. This way your sound will be exported on frame 2 and your two frame preloader should pick up the size of the sound and use it in your getBytesLoaded() == getBytesTotal() calculation. Using frame 3 as I previously suggested probably meant the sound was never exported and included until the preloader had finished! Not what was required at all.

              As you have found out, having the sound already on the stage means it is automatically included in the getBytesLoaded() == getBytesTotal() calculation, hence your animation and sound work. The problem here is exporting the sound in the right frame to get its' size included in the calculation.
              • 4. Re: preloader snag
                Did this actually work for anybody?

                I am having the same trouble (and had already tried this solution based on other research). Since sounds are not classes or componenets they do no get exported at all when I uncheck the first frame option then place a number in the "export frame for classes" proof of this is the drastic drop is size of the swf file.

                I even tried placing the swf file using loadmovieclip in another swf that only had a loader graphic and loaded the external swf in. Once again there are sound issues. If I check the main swf file sounds play normally (if exported to frist frame) the seperate pre-loader worked great at giving me a quick "loading" screen, but when the external file did load none of the sounds were present.


                Any Ideas/help?