3 Replies Latest reply on Jun 8, 2010 5:08 AM by PJSB_DK

    Actionscript - How to keep the weight down


      When creating banner ads, the weight is always an issue. One easy way to loose a few kb is to decrease the quality of any images in the ad. But how about your code? How does one efficiently slenderize Actionscript? Take a library such as TweenLite for instance, it consists of files above at least 60kb, but it only adds less than 5kb to your swf. Then again, I have written pieces of considerably lighter code, which in the end has added a lot more than 5kb to my swf.


      What adds to the weight, and what does not? What should you try to avoid when weight is a problem?



        • 1. Re: Actionscript - How to keep the weight down
          PJSB_DK Level 3



          Well, that's a hard one..It's a balance of ..well everything..

          Visually pleasing, smooth execution etc.....

          There are times, when the size does not matter..It's all

          in the eyes of the beholder.


          Reduce image resolution and number of colors

          Externally load media when possible..

          import only what you need.

          Reuse created objects when possible.


          Just to name a few...


          Nowadays, the size is less of a concern due to faster connections.


          Whether your swf file is 200 kb , 800 kb or higher is not what should

          be your primary focus..The end product is.


          Best of luck

          • 2. Re: Actionscript - How to keep the weight down
            j.baldursson Level 1

            Well, I really wish it was that easy... As I was saying, these thoughts came to mind when creating banners ads, and for those who do not know, there are very strict and tight weight limits set by the media agencies that just aren't negotiable.


            I may have to create a banner ad with large pictures, lot's of animations and user interactivity and what not, and the swf still needs to weigh less than 40kb.


            I already know the obvious tricks, like reducing image quality and such. This is clearly not what I'm after. I'm talking actionscript only, and how to program to keep the compiled code as light as possible.


            It would be interesting to have someone with a deeper understanding of the Flash compiler, to share their thoughts on this issue.

            • 3. Re: Actionscript - How to keep the weight down
              PJSB_DK Level 3

              I already knew that agencies have very specific demands..


              Thought you were talking in general terms.


              Didn't know you wanted specific instructions to

              compiler constants and extreme code reusability


              Hope you find what you need.


              Best regards