Flex 2 Shortcuts

Interest in Adobe Flex has really heated up with the release of Flex 2, and because so many people are starting to use Flex there is huge demand for training courses. I am certified by Adobe to teach Flex (among other technologies) and during my Flex courses I demonstrate a lot of useful short-cuts. I am constantly asked for a site that lists these; therefore, I have compiled a short list of the Flex Builder short-cuts I use every day:

(ordered by usefulness)

  • Ctrl+Space … Content assist (aka Code Hinting) – Shows you most of the available tags or properties appropriate for your cursor position
  • Shift+Enter … Adds a new line below the current line (extremely useful in mxml as you enter tag properties, this means you don’t have to hit the arrow key to move outside the quotation marks
  • Crtl+Enter … Adds a new line above the current line
  • Ctrl+D … Delete the current line
  • Alt+Down … Moves the current line down (passing through any lines below it).
  • Ctrl+L … Go to line number (popup window).
  • Ctrl+Shift+C … Adds a comment around the currently selected text (MXML and ActionScript).
  • Ctrl+Alt+Up … Duplicates current line.
  • Ctrl+Click … Allows you to click on a class in AS or MXML and open that class file.

Indenting: Since we all use good coding form and properly indent all child tags it is important to know some tricks to this. Most code editors support multi-line code indenting, which means you can highlight multiple lines and press the Tab key to indent all of those lines. Try that in a word processor and it will delete the text, but most code editors (Flash, Se|py ActionScript Editor and Flex Builder/Eclipse) support this. Also, you can reduce the indent across multiple lines by pressing Shift+Tab.

There are also some workflow tricks I find very useful. First, I always use “Build Automatically” available in the “Project” dropdown menu (unless the project is extremely large, and you’ll know when it’s too large for this). With this enabled, Flex Builder will automatically generate the SWF and HTML file for viewing. Watch the bottom right corner of Flex Builder in the status bar for the building status; when “Building Workspace” disappears, you can simply hit F5 (refresh/reload) in your browser to see any changes you made to your Flex project. If you try to refresh or reload before the workspace has been built you will get an empty SWF file.

This isn’t a Flex Builder shortcut, but when you have the Flex Data Services server console open, you can use Ctrl+C to “Close” (shutdown) the server.

This list is by no means complete, but simply a list of my favorite shortcuts. This list will continue to grow as other shortcuts creep into my daily finger dance. To see a complete list of shortcut keys, press Ctrl+Shift+L in Flex Builder.

Chad

One thought on “Flex 2 Shortcuts

Leave a Reply

Your email address will not be published. Required fields are marked *