3 Replies Latest reply on Dec 22, 2011 8:45 AM by MotionMaker

    Does Flex Builder remove unused code?

    puddytat5000 Level 1

      Hi, I have alot of dead code in app that is resulting in an unnecessarily large SWF. Is there a way to make the flex compiler remove unused functions?

        • 2. Re: Does Flex Builder remove unused code?
          drkstr_1 Level 4

          The best you can do is select each method name, right click, and do a search for references in the workspace. If it doesn't find anything, it's probably safe to delete.

          • 3. Re: Does Flex Builder remove unused code?
            MotionMaker Level 1

            Although tedious, drkstr_1 has the plan of action. Generally you should need to clean up orphaned code and remove all trace statements. I often see the tracing statements of other Flash Player products when doing development and some are quite revealing if not embarrasing.


            Also "unnecessarily large swf" begs the question what is large? If in Flash IDE did you run the bandwidth report to see exactly what makes it "unnecessarily large swf". You see this option in the publish settings.


            Typically code is not going to make a "unnecessarily large swf" but rather digital assets embedded and fonts embedded. Code could make it "unnecessarily large swf" if there are lots of libraries you are using and you are only using some tiny part of the library which you could refactor or find a snippet on the net.


            Last "unnecessarily large swf" in relation to what bandwidth? Do you have a targeted minimum bandwidth to make the assessment "unnecessarily large swf"?