3 Replies Latest reply on Jul 18, 2009 7:59 PM by fred@fredhughesdesign.com

    loading times effect movie performance

    fred@fredhughesdesign.com

      How can I speed up the loading time of my website for viewers so my

      buttons work properly ?

       

      If you click on the 2nd and 3rd instance of a button on my opening page too quickly,

      which navigate to later parts of the movie, the buttons don't work properly and you

      get a message "error #2004 incomplete load". If you wait 10 or 15 seconds

      (depending on the system) the buttons work properly.

       

      Will compressing my movie when publishing the .swf speed up loading time for the

      web viewer or just degrade my file  ?

       

      Thanks to anyone who might have some input on this

      particular question.

       

      Fred... (fredhughesdesign.com)

        • 1. Re: loading times effect movie performance
          Rothrock Level 5

          The compress setting in the publish settings is safe to use -- if that is the one you are asking about. It just compresses the size of the swf file with a lossless compression. So that is one thing you can do.

           

          Another is that you could add a preloader -- some code that doesn't let the site actually start working until the whole thing is loaded. Usually a preloader shows some interesting animation to indicate to the user how long they will have to wait. If you are certain that you content downloads in about 10 or 15 seconds that is probably pretty good.

           

          If the file gets much bigger than that you might want to look into putting some of the assets into external files and doing dynamic loading.

           

          To do a short preloader add a frame at the beginning of your timeline and add this code"

           

          stop();

          this.onEnterFrame=function(){

          var bl:Number=this.getBytesLoaded();

          var bt:Number=this.getBytesTotal();

          var percent:Number=100*bl/bt

           

          if(bl==bt && bl>40){

          delete this.onEnterFrame;

          this.gotoAndPLay(2);

          }

          }

           

          You could add some little animated movieclip to that frame which would keep running and provide some visual "eyecandy" while the user waits. But you will want to keep that artwork simple. All the content of frame 1 must download before anything can start running. That will just make it stay on. If you have a lot of components in the library or many other things set to export for actionscript you might also have a long delay.

           

          Or you might want to do some kind of code to make the animation. Often that will have a smaller footprint.

          • 2. Re: loading times effect movie performance
            fred@fredhughesdesign.com Level 1

            Thank you very much Rothrock, I will try the compression and the preloader

            code you were nice enough to share with me.

            Fred...

            • 3. Re: loading times effect movie performance
              fred@fredhughesdesign.com Level 1

              Rothrock,

               

              I finally got around to trying this code. I added a frame at the 

              beginning of my time line and then placed the component "progress bar" 

              with some simple text that I made fade in and out as a movie clip for 

              the simple visual

              eye candy and I got a warning about needing an "indentifier" prior to 

              line 2 of your code.  The effect I was looking for was the type to 

              fade in and out while the progress bar rolls and then be navigated to 

              frame 2 which is the first frame of my movie when the loading is 

              complete. Can you please help ?

               

              Thank you,

               

              Fred...