5 Replies Latest reply on Dec 4, 2014 9:27 AM by kglad

    Flash problems, seeking expert answers please

    nyds0806 Level 1

      File in question: Gisser Automotive - Rare Growth Stock Opportunity

       

      1) Here is the basic code for the preloaded I use:

      stop();

      this.addEventListener(Event.ENTER_FRAME, loading);

      function loading(e:Event):void{

      var total:Number = this.stage.loaderInfo.bytesTotal;

      var loaded:Number = this.stage.loaderInfo.bytesLoaded;

      loadingbar3.scaleX = loaded/total;

      loadText.text = Math.floor((loaded/total)*100)+ "%";

      if (total == loaded){

      play();

      this.removeEventListener(Event.ENTER_FRAME, loading);

      }

      }

       

       

      2) I create motion through Classic Tweens

       

      3)  Any suggestions so slower machines don't experience jerky motion?

       

      4) What method in Photoshop will "optimize" the images? And do I need to worry now after the Flash is completed, if the swf file is 4 MB or less?

       

      5) Images are mostly PNG 24. What step(s) would you take using Photoshop to optimize this file type?

       

      6) If in Flash Publish settings, I adjust image quality, say down to 80% or so, won't this override any image settings or optimization made in Photoshop?

       

      7) My client asked if there is another export file format besides .swf, and also if this alternative format will retain interactivity and remove any glitches in motion.

       

      8) Please inform me if you see this jittery animation, and also, exactly what your PC configuration/RAM/OS/browser is.

       

      In summary. we are trying to eliminate jerky motion, making it run smooth, and reduce file size so slower PCs view this Flash without jittery animaiton.

       

      Thank you.

        • 1. Re: Flash problems, seeking expert answers please
          kglad Adobe Community Professional & MVP

          the single most effective and easy to implement option to smooth animation is to enable cacheAsBitmap where beneficial and, if using an air app, use cacheAsBitmapMatrix where beneficial.

          • 2. Re: Flash problems, seeking expert answers please
            nyds0806 Level 1

            Kglad,

             

            1) Please explain what steps I take to "cacheAsBitmap".

             

            2) Also, what about other settings like hardware acceleration?

             

            3) Is there a way to export this .fla as other file formats?

             

            4) If in Flash Publish settings, I adjust image quality, say down to 80% or so, won't this override any image settings or optimization made in Photoshop?

             

             

            Thank you

            • 3. Re: Flash problems, seeking expert answers please
              kglad Adobe Community Professional & MVP

              there are a myriad of things that can be done without decreasing quality.  below  are two pages from a 65 page chapter (optimizing game performance) in a book i worte (Flash Game Development: In a Social, Mobile and 3D World)

               

              here's some info about cacheAsBitmap, Flash CS4 Professional ActionScript 2.0

               

               

              Unfortunately, I know of no completely satisfactory way to organize this information. In what follows, I discuss memory management first with sub-topics listed in alphabetical order. Then I discuss CPU/GPU management with sub-topics listed in alphabetical order.

              That may seem logical but there are, at least, two problems with that organization.

              1. I do not believe it is the most helpful way to organize this information.
              2. Memory management affects CPU/GPU usage, so everything in the Memory Management section could also be listed in the CPU/GPU section.

              Anyway, I am going to also list the information two other ways, from easiest to hardest to implement and from greatest to least benefit.

              Both of those later listings are subjective and are dependent on developer experience and capabilities, as well as, the test situation and test environment. I very much doubt there would be a consensus on ordering of these lists.  Nevertheless, I think they still are worthwhile.

               

               

              Easiest to Hardest to Implement

              1. Do not use Filters.
              2. Always use reverse for-loops and avoid do-loops and avoid while-loops.
              3. Explicitly stop Timers to ready them for gc (garbage collection).
              4. Use weak event listeners and remove listeners.
              5. Strictly type variables whenever possible.
              6. Explicitly disable mouse interactivity when mouse interactivity not needed.
              7. Replace dispatchEvents with callback functions whenever possible.
              8. Stop Sounds to enable Sounds and SoundChannels to be gc'd.
              9. Use the most basic DisplayObject needed.
              10. Always use cacheAsBitmap and cacheAsBitmapMatrix with air apps (i.e., mobile devices).
              11. Reuse Objects whenever possible.
              12. Event.ENTER_FRAME loops: Use different listeners and different listener functions applied to as few DisplayObjects as possible.
              13. Pool Objects instead of creating and gc'ing Objects.
              14. Use partial blitting.
              15. Use stage blitting.
              16. Use Stage3D.


               

              Greatest to Least Benefit

              1. Use stage blitting (if there is enough system memory).
              2. Use Stage3D.
              3. Use partial blitting.
              4. Use cacheAsBitmap and cacheAsBitmapMatrix with mobile devices.
              5. Explicitly disable mouse interactivity when mouse interactivity not needed.
              6. Do not use Filters.
              7. Use the most basic DisplayObject needed.
              8. Reuse Objects whenever possible.
              9. Event.ENTER_FRAME loops: Use different listeners and different listener functions applied to as few DisplayObjects as possible.
              10. Use reverse for-loops and avoid do-loops and while-loops.
              11. Pool Objects instead of creating and gc'ing Objects.
              12. Strictly type variables whenever possible.
              13. Use weak event listeners and remove listeners.
              14. Replace dispatchEvents with callback functions whenever possible.
              15. Explicitly stop Timers to ready for gc.

                16. Stop Sounds to enable Sounds and SoundChannels to be gc'd

              1 person found this helpful
              • 4. Re: Flash problems, seeking expert answers please
                nyds0806 Level 1

                Thanks....most don't apply to this simple Flash.

                 

                Can the .fla or .swf be exported or saved as another filetype, retaining interaction and audio?

                 

                Is there another pre-loader that you suggest, or is mine properly configured?

                • 5. Re: Flash problems, seeking expert answers please
                  kglad Adobe Community Professional & MVP

                  no.

                   

                  your preloader could be better but it has nothing to do with a performance problem after advancing beyond the preloader.