public

Flash Builder generates the following code whenever it tries to generate a function. I want this fixed.

  • Download Gist
1.whatFlashBuilderGenerates.as
ActionScript
1 2 3
public function functionName():void
{
}
2.whatFlashBuilderShouldGenerate.as
ActionScript
1 2
public function functionName():void {
}

A six pack of beer to the person who shows me how to fix this.

At AdobeMAX 2010, one of the presenters showed off Flex Formatter, which can do this automatically. It's not perfect—it doesn't handle object literals well—but it does the job.

Go to Window->Preferences then drill down to FlashBuilder->Editors->CodeTemplates->Actionscript . Look for functions in the list, select it and click edit, move the curly brace and then click Apply. Though adobe uses Java style curly braces on seperate lines for all of their sample code, so making that a default might be contentious on a group project.

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.