Sometimes it’s the small things (like shortcuts)
Over the last few days I've learned about two small things in Flex that I really like. Bookmarks and the Ctrl+Space shortcut. It's because of these two items that I've decided to make a new category named "Shortcuts" in which I will make quick, short posts about... well, shortcuts. Some of these will be items that I may have seen before but never paid much attention to and some of them will be things that I never knew existed. At any rate it will be a category that can be used to find quick little tips that may help increase productivity by speeding things up (even if only by 1 second in each instance). So to start off this category I'll talk about the two that I've just learned.
Product: Flex Builder 3
Shortcut: Bookmarks
I picked this one up at Marco Casario's blog and I was immediately asking myself why I had ignored this in the past. These bookmarks are basically what you would expect them to be by their name and they are awesome. Since reading Marco's post I've been adding/using bookmarks like crazy so I can jump right to any function, variable, etc in any file at any time.
Product: Flex Builder 3
Shortcut: Ctrl+Space
The Ctrl+Space shortcut is one I just learned about a few minutes ago while working through the introduction to Cairngorm (yes, I've decided I need to pick up Cairngorm). The Ctrl+Space shortcut is great especially in a situation where you need to move a variable declaration from one class to another (or from a mxml file to a class).
So here's the situation: You have cut the variable declaration from the AS in your mxml file and pasted it in your class. Since you pasted it instead of typing it in directly, Flex doesn't automatically include the import line. By placing your cursor at the end of the name of the class and pressing Ctrl+Space, Flex will add the import line for you. So in this instance:
-
private var myVar:URLStream = new URLStream();
You would place your cursor after the "m" in "new URLStream" and press Ctrl+Space and Flex would respond my placing the import line at the top of your class:
-
import flash.net.URLStream;


