4 Replies Latest reply on May 3, 2006 6:55 AM by Newsgroup_User

    Evaluating ActionScript 2.0 Byte compression data

    Level 7
      I am charged with determining the details of the size of a 441KB swf.

      I see AS files of 160KB and around 2K embedded AS in the FLA. The Flash
      developer also used a Button and TextArea component so as I recall there is
      a 40K approx hit for using one Component.

      The "size report" has at the end of the listing of embedded AS byte sizes
      this line

      161000 ActionScript 2.0 Classes

      What I am trying to determine is if that last line is the actual AS byte
      complement in the publish SWF. If so it seems high as I though there was
      more compression of AS than 200KB to 161KB.





      --
      Lon Hosford
      www.lonhosford.com
      May many happy bits flow your way!


        • 1. Re: Evaluating ActionScript 2.0 Byte compression data
          Level 7
          What are these figures you are quoting re 160K, 2K, 40K, 200K, 161K etc ...
          its not terribly clear, and why do your really need to know?

          You do realise the ActionScript does not get written into the SWF file .. it
          gets compiled into bytecodes. So you cannot do any meaningful comparison
          between .AS files and .SWF file.
          --
          Jeckyl


          • 2. Re: Evaluating ActionScript 2.0 Byte compression data
            Level 7
            >>>You do realise the ActionScript does not get written into the SWF file ..
            >>it gets compiled into bytecodes.
            Yes.

            >>What are these figures you are quoting re 160K, 2K, 40K, 200K, 161K etc
            >>... its not terribly clear?
            160 K in external AS files. They are the file system numbers I added up.


            2k AS inside the FLA such as on frames or in MCs. This you get this data in
            the "Size Report" sample below.
            161 K is one line item appears at the bottom the "Size Report" after the
            listing of internal AS see below.

            ActionScript Bytes Location
            ------------------ --------
            .... .......
            57 someobj:background:1
            55 someobj:background:1
            61 someobj:fill:1
            161000 ActionScript 2.0 Classes

            Are these numbers the "bytecode" numbers or are they the raw AS numbers? In
            particular is the 161K all the external AS files including those from using
            Flash UI components.

            >>and why do your really need to know?
            The number in the "Size Report" just seems to high for the raw AS bytes
            involved. It seems to me that in the past when I added say 10K of AS to a
            FLA and published I did not see a 10K increase in size. There is a
            compression factor and I thought the size report should show me that.

            >>So you cannot do any meaningful comparison between .AS files and .SWF
            >>file.
            Once you subtract the size of the swf without AS and then add the AS in you
            have a comparison. Publish without the AS, see the size. Add back in the AS,
            publish, see the size. Add a few more lines of code see the size. I have
            done this where the size of the files needed to be within strict guidelines
            as to size and adding an extra property or method would have to be measured
            that way. And to repeat in doing that I recall there is not a 1 to 1
            increase in size for each character of AS added.

            --
            Lon Hosford
            www.lonhosford.com
            May many happy bits flow your way!
            "Jeckyl" <jeckyl@hyde.com> wrote in message
            news:e394aq$259$1@forums.macromedia.com...
            What are these figures you are quoting re 160K, 2K, 40K, 200K, 161K etc ...
            its not terribly clear, and why do your really need to know?

            You do realise the ActionScript does not get written into the SWF file .. it
            gets compiled into bytecodes. So you cannot do any meaningful comparison
            between .AS files and .SWF file.
            --
            Jeckyl


            • 3. Re: Evaluating ActionScript 2.0 Byte compression data
              Level 7
              > Are these numbers the "bytecode" numbers or are they the raw AS numbers?

              But you said you knew that the AS files are not copied into the SWF .. you
              cannot look at external AS file and see how big they are (assuming that is
              what a 'raw AS number' means) and compare to what is in the SWF. What you
              say you know vs what you're then talking about seem to be at odds here. Or
              maybe you're making up your own terminology and so I don't understand what
              you're saying.

              >>>and why do your really need to know?
              > The number in the "Size Report" just seems to high for the raw AS bytes
              > involved. It seems to me that in the past when I added say 10K of AS to a
              > FLA and published I did not see a 10K increase in size. There is a
              > compression factor and I thought the size report should show me that.

              It makes no sense so compare 10K of AS with 10K of compiled script.
              Generally the compiled script will be smaller (but not always).

              > Once you subtract the size of the swf without AS and then add the AS in
              > you have a comparison. Publish without the AS, see the size. Add back in
              > the AS, publish, see the size. Add a few more lines of code see the size.
              > I have done this where the size of the files needed to be within strict
              > guidelines as to size and adding an extra property or method would have to
              > be measured that way. And to repeat in doing that I recall there is not a
              > 1 to 1 increase in size for each character of AS added.

              If you are worried about file sizes .. do NOT use the build-in components.
              Make the stuff from scrathc.. you'll save lots of space because built-in
              components have to have enough script to allow for every possible variation
              (even though you only use one particular setting). They are very hungry.
              At least you do only get the overhead one for each type of component .. but
              its a big overhead ifyou're after small files.

              Anyway .. I still don't see what you're asking about .. what is the problem
              here?
              --
              Jeckyl


              • 4. Re: Evaluating ActionScript 2.0 Byte compression data
                Level 7
                We are not building an movie, we are evaluating what is making an app 415KB
                and why the "Size Report" is reporting a code size of 161K. We intend to use
                this movie as a basis for another movie to save development time and we are
                asked why the size is so big and how to reduce it as the next version has a
                higher level of requirements and complexity. It is interactive product
                simulation maintaining state which can be complex.

                Of the 415K of the swf we can account for the assets impact such as the
                needed high quality bit map images of the product. The 161K of AS is got me
                baffled.

                So here is another approach. We created a blank movie and just imported the
                custom OO classes in the production app and added the one Flash UI Component
                Button and Text Area. Nothing more. Other than the about 2K of Actionscript
                in the FLA they are seem to be the same as far as external AS code but sizes
                of report AS are dramatically different.

                The "Size Report" for this swf show:
                ActionScript Bytes Location
                ------------------ --------
                0 Scene 1:Layer 1:1
                46
                55
                58981 ActionScript 2.0 Classes

                The same AS code and components in the production movie shows:
                ActionScript Bytes Location
                ------------------ --------
                .... .......
                57 someobj:background:1
                55 someobj:background:1
                61 someobj:fill:1
                161000 ActionScript 2.0 Classes

                The production movie was made in 2004 MX and we have now saved as a Flash 8
                FLA.

                The Flash Developer loads the custom classes using the MovieClip Linkage
                approach.

                What is causing the difference in the size reports and for that matter the
                size of the swf as the numbers are the same?

                Is it the moving the file forward from FLA MX 2004 to FLA 8? Is it the
                manner the OO is imported?

                --
                Lon Hosford
                www.lonhosford.com
                May many happy bits flow your way!
                "Jeckyl" <jeckyl@hyde.com> wrote in message
                news:e39dl0$bjq$1@forums.macromedia.com...
                > Are these numbers the "bytecode" numbers or are they the raw AS numbers?

                But you said you knew that the AS files are not copied into the SWF .. you
                cannot look at external AS file and see how big they are (assuming that is
                what a 'raw AS number' means) and compare to what is in the SWF. What you
                say you know vs what you're then talking about seem to be at odds here. Or
                maybe you're making up your own terminology and so I don't understand what
                you're saying.

                >>>and why do your really need to know?
                > The number in the "Size Report" just seems to high for the raw AS bytes
                > involved. It seems to me that in the past when I added say 10K of AS to a
                > FLA and published I did not see a 10K increase in size. There is a
                > compression factor and I thought the size report should show me that.

                It makes no sense so compare 10K of AS with 10K of compiled script.
                Generally the compiled script will be smaller (but not always).

                > Once you subtract the size of the swf without AS and then add the AS in
                > you have a comparison. Publish without the AS, see the size. Add back in
                > the AS, publish, see the size. Add a few more lines of code see the size.
                > I have done this where the size of the files needed to be within strict
                > guidelines as to size and adding an extra property or method would have to
                > be measured that way. And to repeat in doing that I recall there is not a
                > 1 to 1 increase in size for each character of AS added.

                If you are worried about file sizes .. do NOT use the build-in components.
                Make the stuff from scrathc.. you'll save lots of space because built-in
                components have to have enough script to allow for every possible variation
                (even though you only use one particular setting). They are very hungry.
                At least you do only get the overhead one for each type of component .. but
                its a big overhead ifyou're after small files.

                Anyway .. I still don't see what you're asking about .. what is the problem
                here?
                --
                Jeckyl