3 Replies Latest reply on Jun 16, 2014 12:45 PM by kglad

    Any ideas for reducing lag in my animation (flash cs6)?

    TeganVawter

      I'm creating something for a local college in Flash CS6 and it lags in a couple spots (in the very beginning after clicking enter and after clicking on a location on the map) and it would obviously be really nice to get rid of that lag. The only thing i know to try in order to help with lag is to break down all grouped artwork and to convert tweens into frame by frame. I've done this and it hasn't changed anything so I was hoping someone else would have another idea. Ive uploaded the swf and flash file to dropbox. What is in the dropbox is not the final product I need to add the videos thats are going to be in it (they pop up once you press the play button) but other then the videos that is as complicated as the file is going to get. This lag started happening from the get go of working on this project once I had the barebones of the menu system figured out. It hasn't gotten any worse since then even after all the things I've added.

       

      Dropbox - Adobe Q

       

      Let me know if there is more information you want me to provide. Im really willing to try anything to sort this out.

       

      Thanks in advance.

        • 1. Re: Any ideas for reducing lag in my animation (flash cs6)?
          kglad Adobe Community Professional & MVP

          the following is an excerpt (Flash Game Development: In a Social, Mobile and 3D World),

          Optimization Techniques

           

          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
          • 2. Re: Any ideas for reducing lag in my animation (flash cs6)?
            TeganVawter Level 1

            I would love to try some of these out to see if they would help but besides a few of those, you might as well be speaking a different language. I'm not sure what most of that means and obviously because of that, have no idea how to go about doing those things if some of those to actually pertain to my project.

             

            Maybe someone could look at my project and give me suggestions specific to my project? Or walk me through some of these things listed/direct me to a place that could walk me through going about doing some of these things? I know its a lot to ask but it would be the most efficient way to figure this out.

             

            Thanks for your reply though kglad.