Instructions on how to set up the Flash IDE for hassle-free AS3 development
Wednesday, October 6th, 2010
Flash has a few places where you can set preferences, some of which are saved globally, some of which are saved per file. The per-file settings are a pain as they are forgotten for new files.
This post describes how to:
- Disable file-specific global warnings, such as migration warnings for onMouseDown
- Use File > New File > Templates to specify default settings, such as turning off Always declare stage instance
I tried the adobe-recommended handler names for about 6 months before reverting back to onMouseDown etc which is far more readable in both the code and project outline in FlashDevelop. The thing is, Adobe by default in ActionScript 3.0 you get a migration warning on every publish. Annoying!
I’ve finally found out that you can toggle these warnings using the EnabledWarnings.xml file, by simply setting the enabled attribute to false for the desired warning.
The file can be found in the following location:
Win: C:/<Install Path>/<Version>/en/Configuration/ActionScript 3.0/EnabledWarnings.xml Mac: HD|Applications|<Version>|Configuration|ActionScript 3.0|EnabledWarnings.xml
There are about 30 warnings in all, covering possible mistakes, coding style, and AS2 to AS3 code migration.
Setting default file / file preference settings
Did you know that it’s possible to create your own file templates, complete with settings found in:
File > Publish Settings... > Flash > ActionScript 3.0 Settings...
- Export classes in frame n
- Strict mode
- Warnings mode
- Automatically declare stage instances
If you simply create a folder called Templates in your user Configuration folder, then a named subfolder, and save an .fla file in there, it appears in the File > New > Templates list.
Not only this, but:
- The template group shows on the Flash startup screen
- File > New remembers your choice, so automatically pre-selects the last-used template
- The File > New > Templates tab, Category and Template choice is remembered between sessions
I now have a folder called Templates/Development, and a few different .fla files in there, all with the settings I mentioned above.
You could easily add some files with default timeline testing code, a few symbols, fonts, etc, as well.