Friday, January 7, 2011

Beginner’s Guide to FlashDevelop – Basix

Beginner’s Guide to FlashDevelop – Basix:

Two common misconceptions about Flash Professional: first, you have to buy it in order to make Flash apps and games; second, it’s a decent tool for writing code. Totally untrue.

In this article, we’ll see how to use the free Windows application FlashDevelop to work on Flash projects — both with and without Flash Professional.


What’s So Great About FlashDevelop?

You can create Flash projects with any text editor, so what makes FlashDevelop so special? Here are my top six favorite features:

Code Completion

Type someMovieClip.got and it’ll offer gotoAndPlay() and gotoAndStop() as possible options to choose from. You can continue typing to narrow the choice down, or use the arrow keys to select a specific option, then hit the Tab key to make FlashDevelop automatically write the rest of the keyword.

FlashDevelop Code Completion

Also, FlashDevelop can match text from anywhere within the keyword, so someMovieClip.pla will offer both play() and gotoAndPlay() as possible options.

Automatic Imports

Type myMovieClip = new MovieClip(); and FlashDevelop will automatically add import flash.display.MovieClip; to the correct place at the top of the class file.

This also works for classes that aren’t built in to Flash, including classes that you’ve written yourself. If your project contains the class com.activetuts.examples.ExampleClass then you can type var myExample:com.activetuts.examples.ExampleClass; and FlashDevelop will import the class and shorten that line to var myExample:ExampleClass;. (Of course, thanks to code completion, you only need to type var myExample:com.act«Tab».ex«Tab».Cla«Tab»;.)

FlashDevelop Automatic Imports

Our higher-level tutorials on Activetuts+ often don’t explicitly mention the import statements, since we assume that you’re using a code editor that takes care of this for you.

Automatic Class Creation

To create this com.activetuts.examples.ExampleClass class, you can right-click a folder within FlashDevelop and select Add | New Class…:

FlashDevelop Automatic Class Creation

The New Class dialog will appear:

FlashDevelop New Class dialog

You can type the desired package name into the Package field (even if the \com\activetuts\examples\ folder structure doesn’t exist) and the desired class name into the Name field. FlashDevelop will then create the folder structure (if needed) and a new AS file, ExampleClass.as [...]

No comments:

Post a Comment