The Flex Builder editors provide shortcuts for writing and formatting your code. These include quickly adding comment blocks, indenting code blocks, finding, and replacing text.
When you use Content Assist in the MXML and ActionScript editors, the packages in which classes are located are automatically imported into the document. They are added in the order in which they were entered into code. Imports that are unused or unneeded are automatically removed.
To help organize the code in your ActionScript documents, you can alphabetically sort import statements. To do this, open the Preferences dialog, select Flex > Editors > ActionScript Code, and then select "Keep Imports Organized."
With an ActionScript document that contains import statements open in the editor, press Control+Shift+O (Windows) or Command+Shift+O (Mac OS).
You can quickly add or remove comments using keyboard shortcuts. You can add comments (//) and comment blocks (/* */) to ActionScript code. You can add XML comments (<!-- -->) and CDATA blocks to MXML code. Comments in ActionScript code can be toggled on or off.
Toggle comments in ActionScript code
The editor automatically formats the lines of your code as you enter it, improving readability and streamlining code writing. You can also use the Tab key to manually indent individual lines of code. If, however, you want to indent a block of code in a single action, you can use the Shift Right and Shift Left editor commands.
Shift a code block to the left or right
To find and optionally replace text strings in your code, there are two options. You can search the document that is currently open in the editor, or you can search all resources in the projects in the workspace. For more information about searching the entire workspace, see Finding references and refactoring code.
If the text string is located in the document, it is highlighted and, optionally, replaced.