02
Aug
08

Viewing a Flex application’s generated source code

The following example shows how you can view a Flex application’s generated source code by adding the -keep compiler argument in Flex Builder.

To add a compiler argument in Flex Builder, launch the Project Properties dialog box by selecting Project > Properties from the main menu, select the Flex Compiler option from the left menu, and type “-keep” at the end of the Additional compiler arguments text input field (see Figure 1).

Flex Builder Project Properties dialog box
Figure 1. Flex Builder Project Properties dialog box.

Full code after the jump.

View MXML

<?xml version="1.0" encoding="utf-8"?>
<!-- http://blog.flexexamples.com/2008/08/02/viewing-a-flex-applications-generated-source-code/ -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white">

    <mx:Label text="Right click this Flex application and select 'View Source' to view generated source code." />

</mx:Application>

View source is enabled in the following example.

The generated source code will appear in a /generated/ folder within the Flex Builder project’s /src/ folder. If your MXML file was named main.mxml, the generated file could be found at /generated/main-generated.as.


1 Response to “Viewing a Flex application's generated source code”


  1. 1 abhishek Sep 21st, 2008 at 10:36 pm

    hello,
    i’m not use tht -keep option , but still i store bin-release folder at server side then also i’m able to see tht source code with right click option, we can also use while export file, Enable View Source check box is to clicked ,
    :)

Leave a Reply

This blog is terrible at eating HTML tags. If you plan on posting code/XML, please escape your "<" characters as "&lt;" and your ">" characters as "&gt;".




Badge Farm

  • Firefox 2
  • Powered by Redoable 1.2
  • Feeds burnt by Feedburner
  • Feed