1 Reply Latest reply on Jun 25, 2008 4:30 PM by Garyl Woolworth

    code formatting in flex builder 2 or 3

    larcelarcen
      A ways back I started using Flex 1.5 and have since migrated to Flex 2. In Flex
      Builder for 1.5 there was a feature called Apply Source Formatting which would
      re-format your code in accordance with certain preferences. It was handy in
      keeping the code properly formatted. Flex Builder 2 does not have this feature
      and I miss it. Adobe says they built in automatic formatting into the new
      builders and don't have any plans to re-instate the feature.

      Has anyone found (free?) software that will do this. What I'd really like is a
      formatter that would not only indent mxml tags and AS properly, but would
      organize the attributes within an mxml tag.

      Thanks!
        • 1. Re: code formatting in flex builder 2 or 3
          Garyl Woolworth Level 1
          I often miss this feature as well, my only advice for MXML is to write it correctly the first time. If you are in a class you can do Crtl+Shift+O to organize your imports. Flex Builder 3 tries to do this for you but it does it horribly because I add a lot of my imports I already know I'll need and it removes them as soon as I get two functions deep so I've turned that off. Something else that can help you is copy all of your AS3 code into Flash CS3. Depending on exactly what it is you wrote you can generally use Flash' auto format feature to clean up a lot of code. Not a perfect solution but can be great when recycling someone else' horrible looking code.