Flash builder tips and tips

Source: Internet
Author: User
Tags cdata

This article provides several simple and effective tips, saving time and shortcuts, and other practical information that can improve the efficiency of Flash builder.

Note:The CTRL and ALT keys used in this article are only applicable to Windows. For Mac, the equivalent key of the ctrl key (WIN) is the command key, while the equivalent key of the Alt key (WIN) is the option key.

Note:Added: new or enhanced features in Flash builder 4.5

Code Completion shortcut

  • Content Assistant-The content assistant provides a list of suggestions based on some input code strings.

    Press Ctrl + Space keyYou can call the content assistant.

  • Code proposal Loop-Press Ctrl + Space key multiple timesYou can filter the list of suggestions provided by the content assistant. Only the attributes, events, and effects are displayed.
  • Complete metadata code-Call the Code Completion prompt for the metadata used in the mxml and ActionScript documents.

    In the mxml document:

    Enter "[" in the <FX: Metadata> or <FX: SCRIPT> tag:

    In the ActionScript document:

    Enter "[" before the class name, variable, Getter, or setter function.

  • Complete the code when the consumer is in use status-If your mxml application has multiple states, selecting a status in the mxml code editor will provide code specific to the selected status.

    You can select a status from the "show status" pop-up menu.

    When multiple states are defined in an application, the mxml Code Editor automatically adds a "display status" pop-up menu, as shown below:

  • Case-insensitive mixed code prompt-Even if you type characters in combination with uppercase and lowercase letters, the flash builder can still display relevant code prompts. For example, to display all the matching properties of the advancecdatagrid control, you only need to typeADG, As follows:

Coding Efficiency tips

  • Access code definition-Press ctrlYou can quickly access the Code definition of a language element. For example, if you want to access a function definition. Hover the pointer over the function name and press Ctrl. The function name is changed to a hyperlink. Click it to go to function definition.
  • Quick access-Press Ctrl + 3Quick access to views, editors, and Common commands.

    Press Ctrl + 3AndPress space keyYou can switch between different editors, views, and perspectives:

    PressCTRL + 3AndType goYou can see all the go to commands:

    You can also type A sub-string or the first letter of the command to display all the matching items. For example, to debug an application,Press Ctrl + 3AndType Deb. Command can also be used to identify case-sensitive and mixed typing.

    The quick access function can store historical records of previously used commands, and recent commands appear at the beginning. For example, if you are debugging an application, the DEBUG command first appears in the history. It helps you quickly execute Common commands.

  • Butler quick Assistant-Press Ctrl + 1You can call quick assistant. The quick assistant function provides context-based assistance to help you quickly perform the following encoding tasks:

    • Rename a file
    • Rename in Workspace
    • Generate getter/setter
    • Convert local variables to Fields
    • Specify to variable
    • Split variable Declaration
    • Organization Import

    For more information about these quick assistant options, see quick assistant *.

    Flash builder can help you locate undefined methods, variables, or classes in the code, and use the quick assistant to generate the stub code. Use an undefined identifier in the code.

    The generated stub code can be used as a placeholder for the code to be implemented later, so that your code will not be incompatible.

    For more information, see generate from usage *.

  • Quick outline-Press Ctrl + OYou can access the "quick outline" view.

    The quick outline view is displayed in a pop-up window in the editor. It is not an independent view. You can use it to quickly navigate and check the code.

    In the quick outline view, first type the first few letters of the content to be searched, and then select it to go to the corresponding line in the code.

  • Pipeline Code Template-The code template allows you to accelerate encoding by automatically inserting common encoding modes. Flash Builder provides more than 100 predefined templates for ActionScript, CSS, and mxml code.

    To insert a code template, you only need to type the Template Name in the code editor, and thenPress Ctrl + Space key. For example, to insert a for loop in the code, just typeforiPress Ctrl + Space key.

    To display all available code templates according to your code context,Press Ctrl + Space key twice.



    To create and edit a code template, go to the "Preferences" dialog box and select "Flash builder"> "Editor"> "code template ".

    For more information, see Code Template *.

  • Organization Import

    Place the cursor on the Import Statement,Press Ctrl + 1Select "Import organization ".

    The import statements should be listed alphabetically by the package name,Press Ctrl + Shift + O.

  • Call hierarchy

    Press CTRL + ALT + HYou can open the "call hierarchy" view. You can use this view to find all instances of a project that use a specific method, attribute, or variable.

    Double-click an item to open the file containing the item and check the code. You can also click a node to view the call stack trace. You can view the call and call of a method in the flex and ActionScript projects.

  • Fixed indentation

    To fix the indentation of a piece of code without using tabs, you can select this code andPress Ctrl + I.

  • Search code

    UseCTRL + FThe shortcut key is used to find and replace the text string in the file currently opened in the (optional) Editor.

    You can use the advanced search feature of Flash builder to search for all resources across projects in the workspace. See the followingAdvanced tips and tipsIn SectionSearch codeReference.

  • Code comment

    You can useCTRL + Shift + cThe shortcut key quickly comment out the code lines in the codes of ActionScript and mxml. This shortcut allows you to switch between adding and deleting comments.

    You can add the following types of Annotations:

    • Source code annotation of ActionScript (//)
    • Block comments of ActionScript (/**/)
    • Asdoc comments of ActionScript (/***/)
    • Mxml block comment (<! ---->)

    To add a CDATA block to mxml code (<! [CDATA []> ),Press Ctrl + Shift + d.

  • Code indent

    Flash Builder automatically indent the code line based on your indent preferences (in the "Preferences" dialog box, select "Flash builder"> "Editor", and specify the indent type and size ).

    However, if you want to fix any indentation, you can do this without using the tab key to manually indent individual code lines.

    You only need to select the code to fix the indentation, and thenPress Ctrl + I.

  • Option block selection and editing mode

    To change multiple instances of a variable or package name, click the flash builder toolbar and select multiple lines of code. All code lines can be modified once.

  • † Format the mxml document

    To format the code by pressing the shortcut key, you can select one or more lines of mxml code, and thenPress Ctrl + Shift + F.

    You can use the "Preferences" dialog box to change the default format. In the "Preferences" dialog box, go to "Flash builder"> "mxml code"> "format" to change the order and group of attributes.

  • Move multiple lines of code

    Select multiple lines of code, and then pressALT and up arrow or down arrowYou can quickly move up or down multiple lines of code.

    Delete multiple lines of code

    Select the lines of code to delete, and thenPress Ctrl + d.

    If you only need to delete the last character in a line of code, you can pressCTRL + backspace.

Debugging skills

  • Conditional breakpoint-You can specify a condition for a breakpoint to stop executing the debugger when a specific condition is met.

    You can configure a conditional breakpoint so that the debugger stops running under any of the following conditions:

    • The expression returns true.
    • The expression value is changed.
    • Reaches the specified hit count.

    To set a condition breakpoint, first pressShift + Ctrl + BSet a breakpoint on a line. Right-click and select "breakpoint properties ". You can specify a condition as multiple expressions separated by commas.

    For more information, see set conditional breakpoints *.

  • Observation Point-You can use the observation point to monitor specific instances of a variable during debugging. When debugging an application, you can set an observation point on a specific instance of the variable and stop the execution when the observed variable value changes.

    To set an observation point in the debugging session, first pressShift + Ctrl + BSet a breakpoint on a line. When debugging stops at the breakpoint, go to the "variables" view, open the context menu of the variable, and select "Switch observation point ".

    For more information, see use observation points *.

  • Expression-You can drag multiple lines of code from the editor to the expressions view to quickly monitor the code expressions.

  • Run to line-Run the "run to line" command to exit the loop during the debugging session.

    During debugging, you may find that the Code executes a repeating loop multiple times. To exit the loop and continue running the next line in the code,Press Ctrl + RYou can use the "run to line" command.

Ui skills

  • Switch View-Press Ctrl + F7You can quickly switch to another view in the Workspace:

  • Switch between source code mode and Design Mode-Press Ctrl + '(left quotation mark)You can switch between the design mode and source code mode.
  • Worker works in both source code and design modes.

    You can select the source code mode and design mode for simultaneously opening the file.

    1. Right-click the editor tab and select "new editor ". At this time, the same file has two editor tabs.
    2. Drag a tab to place the two editor windows side by side.
    3. Set one editor to the design mode and the other to the source code mode.
  • Opening/disabling the design mode

    If you only need to work in source code mode without designing mode, go to the "window" menu and deselect "enable design mode ". Select "enable design mode" to display the design mode again at any time.

  • Loop status

    When multiple States are used in an application, you can traverse different states, view only the Code applicable to specific States, and gray all other code.

    PressCTRL +/You can quickly cycle to the next state, pressShift + Ctrl +/You can go to the previous status.

  • Ghost Sets flash Builder as the default editor for the ActionScript and mxml files

    Open the "preferred Parameters" dialog box, and select "Flash builder"> "File Association ".

    Select the check boxes of the <G id = "1">. As </G> and <G id = "2"> mxml </G> files to set file association.

Advanced tips and tips

  • Tips for using custom triggers to call code-In additionCTRL + Space keyAccess code prompt. You can also specify your trigger key.


    Go to the "Preferences" dialog box and select "Flash builder"> "Editor ". Select "use another Custom trigger" and type the key you want to use as the trigger for the access code prompt.

    Even if you type only one key of the trigger, the code prompt is called. For example, if you specify the trigger key as AB. Both A and B call the content assistant.

  • Search for code reference

    You can find references to code identifiers such as getter and setter, interfaces and classes, variables, and functions.

    To do this, click the code identifier to search for the reference and select search> reference ".

    You can search for references in a file, project, or workspace.

    Press Ctrl + Shift + GYou can find all references in the workspace.

  • Code Reconstruction

    Refactoring allows you to rename a code identifier and automatically update all references to the identifier. Flash builder allows you to perform this operation in three simple steps:

    1. Click a code identifier in the editor, and thenPress CTRL + ALT + R.
    2. Enter a new name for the code identifier.
    3. Click Preview to view the changes between the original code and the restructured code.

    For more information, see search for references and refactoring Code *.

  • Customized flash builder code generated by lightning

    Flash Builder automatically generates pre-defined code when you generate event processing functions, getter and setter, or override and implementation methods.

    You can customize the predefined code generated by flash Builder by editing the code template, as follows:

    1. Open the "Preferences" dialog box and choose "Flash builder"> "Editor"> "code template"> "Flash builder ".
    2. Select the name of the code template to be customized, and click Edit ".

    For more information, see custom code templates *.

  • Override/Implementation Method

    You can select"Source code"> "overwrite/implementation method"Select the method to be overwritten and the method to be implemented.

    For more information, see overwrite or implementation method *.

  • * Exclude files during project Compilation

    You can specify the file type that the flash builder does not want to copy to the Output Folder during project compilation.

    Go to the "Preferences" dialog box and select "Flash builder"> "file exclusion ". You can add new file extensions and names, or delete any existing file extensions and names from the list.

  • Testing applications on different independent flash players

    When you start or debug an application, you can change the independent Flash Player.

    Go to the "Preferences" dialog box and select "Flash builder"> "debug" to change the executable file location of Flash Player.

Search for referenced documents

  • Reference file of ActionScript

    To display the asdoc tooltip,Press F2:

    To display the asdoc view,Press Ctrl + 3And typeAsdocAnd select "View ":

    Flash builder references

    Press F1Call a flash builder reference document specific to a dialog box or wizard.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.