This article provides several simple and effective tips, saving time and shortcuts, and other practical information that can improve the efficiency of Flash builder.
- 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 typefori
Press 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.
- 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.
- 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.
- Right-click the editor tab and select "new editor ". At this time, the same file has two editor tabs.
- Drag a tab to place the two editor windows side by side.
- 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.
- 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:
- Click a code identifier in the editor, and thenPress CTRL + ALT + R.
- Enter a new name for the code identifier.
- 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:
- Open the "Preferences" dialog box and choose "Flash builder"> "Editor"> "code template"> "Flash builder ".
- 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.