The Flex Builder editors provide various ways to help you simplify and streamline code development.
Available in the MXML, ActionScript, and CSS editors, Content Assist provides code hints to help you complete your code expressions. For more information, see About Content Assist.
As you enter code with Content Assist, the fully qualified type names are automatically imported into the document as needed. In an ActionScript document, the fully qualified type name is added to the beginning of the document with the other import statements. In an MXML document, the import statement is added to an existing script block if one exists; if not, Flex Builder creates a script block. In an ActionScript document, you can also optionally sort import statements. For more information, see Organizing import statements.
As you enter MXML code, many syntax elements are automatically added, including: closing tags, indentations, new lines, and CDATA tags within <mx:Script> tags and when you add event attributes.
Context-sensitive language reference Help
The Adobe Flex Language Reference is integrated into the editor and you can easily access it by selecting an ActionScript language element, an MXML component tag or attribute, and then pressing Shift+F2. For more information, see Getting help while writing code.
To streamline the work of coding your applications, the editors can help you reformat blocks of code and perform bulk edits. For more information, see Formatting and editing code.
As you enter code into the Flex Builder editors, Content Assist prompts you with a list of options for completing your code expression (commonly referred to as code hints). For example, in an MXML document you are prompted with the list of tags that can be added at the current location.
Code hints appear automatically as you enter your code. The following example shows the code hints that are displayed when you add a tag to a Canvas tag:
Only those tags that can be added to the Canvas tag are contained in the list of code hints. This is true of all uses of Content Assist: you only see relevant hints.
Code hints are categorized by type, showing you both visual and nonvisual MXML components, events, properties, and styles.
Code hints appear whenever the framework or language (MXML, ActionScript, and CSS) provides options for you to complete the current expression. For example, if you type within an MXML component, you are prompted with a list of all properties of that component. The following example shows code hints for properties of an MXML component:
Selecting and entering properties displays possible property values (if predefined values exist). The following example shows code hints for property values:
Code hints for ActionScript 3.0 are also supported. They are displayed in ActionScript documents, in <mx:Script> tags in MXML documents, and in event attributes. Content Assist provides hints for all ActionScript 3.0 language elements (interfaces, classes, variables, functions, return types, and so on), as the following example shows:
Content Assist also provides hints for CSS styles within embedded <mx:Style> tags or in stand-alone CSS documents, as the following example shows:
In addition to the preceding examples, Content Assist provides hints for any custom MXML components or ActionScript classes that you create yourself and which are part of your project. For example, if you define a custom MXML component and add it to your project, code hints appear when you refer to the component in your MXML application.
You can use code hints to write MXML, ActionScript, and CSS more rapidly and efficiently. Code hints appear as you enter code into the editor.
Display Content Assist and insert code hints:
<
Relevant code hints are displayed, as the following example shows:
public var myVar:
You can also display code hints while you enter a line of code by pressing Control+Space.
As you continue to enter code, additional code hints are displayed.
The Adobe Flex Language Reference is integrated into the MXML and ActionScript editors and you can quickly review the reference Help for an MXML tag or property, a class, or other Flex framework element.
You can also use Dynamic Help, which is docked next to the current perspective and displays reference and usage topics related to the currently selected MXML tag or ActionScript class.
Display language reference Help
For more information about getting help while working in the Flex Builder workbench, see Using the Flex Builder help system.
Select Help > Dynamic Help.