Old Articles - 2 years, 9 months ago - 1 Comment
Flex 2 Compilation - Hidden Goodies
We all like to know a little more about what goes on under the hood of our favourite tools. Undocumented features and the like have a certain appeal that gets everybody excited.
Flex Builder 2 which is currently in public beta has a little known gem of a feature (for which documentation is scarse) which you can use to learn alot more about what Flex actually does under the hood to make all that mxml markup goodness into a working Flash movie. This compiler option did not work in the previous public alpha build.
The brains of Flex 2 lie in the compiler (AKA MXMLC) which internally converts all your mxml markup into Actionscript 3 classes ready for the next stage of the process which is Actionscript compilation. The Flex 2 compiler accepts certain arguments (or compiler flags) that allow you to change the way it operates slightly.
There are plenty of these compiler flags but my favourite has to be the option that tells MXMLC to keep all of the Actionscript 3 classes that it has generated as part of the project building process. You can then view these actionscript files to find out more about how Flex actually works.
The compiler flag i speak of is called -keep-generated-actionscript and you can turn it on in Flex Builder 2 for your own pleasure by doing the following:
- Right-click a Flex Project in the Navigator Panel.
- Select Properties from the Context Menu.
- Select Flex Compiler in the Properties Window.
- Enter -keep-generated-actionscript into the ‘Additional compiler arguments’ field.
- Click ‘OK’ to apply the changes.
- Build your Flex Project by clicking the Run button.
- Right-click your Flex Project again in the Navigator Panel.
- Choose Refresh from the Context-Menu.
- A new folder should appear under your Flex Project in the Navigator Panel, named ‘generated’
Inside the ‘generated’ folder lies the under the hood Actionscript 3 files that the compiler generates as an interim stage of the whole compilation process. Open them up and have a nosey as to what Flex 2 is actually doing under the hood to setup all the default component styles etc… it’s an awesome feature, lets hope they keep it in there.
Enjoy.
1 Comment
Note: This is an old article!
Please be aware that the content of this article may no longer be accurate and the links contained within could be broken.
Update Notifications
You can add our RSS feed to your favorite feed reader or recieve an email when a new article is posted by entering your email address below.
FLASH EXPERTS
- Andre Michelle
- Aral Balkan
- Big Spaceship
- Chafic Kazoun
- Colin Moock
- Craig Swann
- Erik Natzke
- Grant Skinner
- Jesse Warden
- John Grden
- Keith Peters
- Lee Brimelow
- Lord Alex
- Mario Kingemann
- Matt Voermn
- Ralph Hauwert
- Richard Leggett
- Trevor McCauley
FLASH COMPONENTS
- AFComponents
- Components Network
- Extend Studio
- Flash Relief
- Flash Store
- Flashden
- Flashloaded
- Ghostwire
- Image Vue
- Jumpeye
- Page Flip Component
- Slideshowpro
FLASH VIDEO
- Akamai
- FFMPEG
- FlashComGuru
- Flashstreamworks
- FLV Player
- FLVMDI
- flvPlayerPro
- FLVTool2
- Influxis
- JW FLV Player
- Vital Stream
FLASH RESOURCES
- Actionscript.org
- Adobe Labs
- Developer Center
- Flash Interface
- Flash Player Statistics
- Flashkit
- Kirupa
- MDM Zinc
- OSFlash
- PaperVision3D
- SWXFormat
- Tweener
SPONSORS
More In Actionscript
- Adobe MAKE SOME NOISE
- Undocumented Actionscript 3
- BitmapData.loadBitmap gone in AS3
- Actionscript 3 - New Capabilities
- Flash 8 - setTimeout


Thanks, Your tip put initil lights on the FLex.