Adobe Flex 3 Help

About Flex Builder content assistance

The Flex Builder editors provide various ways to help you simplify and streamline code development.

Content Assist

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.

Auto import management

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.

MXML tag completion

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.

Formatting assistance

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.

About Content Assist

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:

Content assist

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:

Code hints

Selecting and entering properties displays possible property values (if predefined values exist). The following example shows code hints for property values:

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:

CSS style hints

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.

Using Content Assist

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:

  1. Begin entering a line of code.
    • In an MXML document, begin entering a tag:

      <

      Relevant code hints are displayed, as the following example shows:

    Relevant code hints

    • In an ActionScript document or a Script tag in an MXML document, enter a typical language construct:

      public var myVar:

    • In a CSS document or a Style tag in an MXML document, enter a style name construct and press Control+Space to display a list of attributes that can be added.

    You can also display code hints while you enter a line of code by pressing Control+Space.

  2. Navigate the list of code hints with the Up and Down Arrow keys.
  3. Select a code hint, press Enter, and the code is added to the editor.

    As you continue to enter code, additional code hints are displayed.

Getting help while writing code

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

  1. In the MXML or ActionScript editor, select a Flex framework element (a word in your code) by highlighting or placing the mouse pointer in the word.
  2. To open the Help topic directly in the Help viewer, press Shift+F2 or select Help > Find in Language Reference.

For more information about getting help while working in the Flex Builder workbench, see Using the Flex Builder help system.

Enable Dynamic Help

 Select Help > Dynamic Help.