Here’s another trick I use quite often in Flash Builder 4.5. To be honest, this feature may have been in Flash Builder 4 and I just didn’t notice it, but I discovered it with Flash Builder 4.5 (and I’ve enhanced it with templates, which are definitely a FB 4.5 feature =).
If you want to override an inherited method (or get/set accessor):
override public function<space>
override protected function<space>
Flash Builder pops up a menu showing all the methods that can be overridden. This is also handy just to see what methods are available.
- Choose a method name from the code hint list.
- Flash Builder creates the method signature complete with parameters and a
However, being me, I like to save keystrokes as much as I can. I created a couple of templates to reduce the typing involved in this process:
- “opf” contains just the text
override public function(including a trailing space)
- “oprf” contains just the text
override protected function(including a trailing space)
Using these templates I just type “opf<space>” (or “oprf<space>”) and the code hint list appears. Then I type the first few characters of the name I want and I’m in business.
As a side note, if you want to customize the code that Flash Builder inserts when it generates the override method, it’s the template named “override method” in the Flash Builder templates category.