Tutorial Details
- Difficulty: Basix
- Platform: Flash
- Software: FlashDevelop
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.

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»;.)

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…:

The New Class dialog will appear:

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:
package com.activetuts.examples
{
/**
* ...
* @author MichaelJW
*/
public class ExampleClass
{
public function ExampleClass()
{
}
}
}
(Note that here it’s automatically added a multi-line comment with my name and space to write a little information about the class — neat.)
If you wanted to extend an existing class — like, say, the Rectangle class — you could specify this in the New Class dialog by clicking the Browse… button next to the Base Class field:

If you check “Generate constructor matching base class” it’ll give the class the same arguments as the Rectangle class that it extends:
package com.activetuts.examples
{
import flash.geom.Rectangle;
/**
* ...
* @author MichaelJW
*/
public class SuperRectangle extends Rectangle
{
public function SuperRectangle(x:Number = 0, y:Number = 0, width:Number = 0, height:Number = 0)
{
super(x, y, width, height);
}
}
}
Likewise, if you specified some interfaces for the class to implement, you could tell FlashDevelop to automatically create stub functions for each of the methods in those interfaces.
Automatic Object Creation
Do you ever type the name of a variable or function before you’ve created it? I do this all the time with event handler functions when defining a listener. I’ll write something like:
menuButton.addEventListener(MouseEvent.CLICK, onClickMenuButton);
…when I haven’t yet defined the onClickMenuButton() handler function.
Well, in FlashDevelop, all you have to do is move the text cursor over the as-yet-undefined keyword and press Ctrl-Shift-1 to bring up this menu:

Hit enter, and FlashDevelop will automatically create a new function, with the correct parameter set up in the signature:
public function ExampleClass()
{
menuButton.addEventListener(MouseEvent.CLICK, onClickMenuButton);
}
private function onClickMenuButton(event:MouseEvent):void
{
}
You can do the same for variables you haven’t defined, private variables for which you want to define public setters and getters, and more. Ctrl+Shift+1 is FlashDevelop’s most powerful shortcut; check out this page of the official documentation and the comments below this article to find out more.
Code Refactoring
Let’s say you’ve created a method called refresh(), but over time you alter what exactly it does so that it’s not just refreshing the data but updating it, too. To keep your code accurate, you want to rename the method to update() — but how? You can’t just do a Find/Replace and change all instances of refresh to update, and finding all the places in the entire project where that class’s refresh() function is called would take forever.
Enter the Refactor menu. Just right-click any function or variable name and select Refactor | Rename…:

All references to the function, across the entire project (including the function itself), will be renamed to whatever you enter.
The Refactor menu lets you do more, like remove import statements that were once necessary but are now unused, though the Rename… method is the one I use most.
Task Tracking via Comments
Sometimes while developing you’ll find a bug that occurs just one time in a million, under very specific cases, and it’s not worth spending hours fixing it. So you slap a quick workaround on there and make a mental note to come back to it later. Of course, it’s difficult to keep track of mental notes…
In FlashDevelop, you can keep track of these by writing comments prefixed with //FIXME:, and they’ll show up in the Tasks panel. So, this:
public function load():void
{
//FIXME: Causes app to crash if loaded on Feb 29th during a solar eclipse
displaySkyline();
…gives you:

It’s also possible to use other prefixes. //TODO: and //BUG: are supported by default, but you can add your own.
Big Deal
Okay, sure, Flash Professional does a lot of that. But FlashDevelop does it better; for example, Flash CS3′s auto-completion requires you to type the capitalization exactly the same as the keyword you’re trying to find, so someMovieClip.gotoand won’t match anything. Flash CS5′s editor is much better that previous versions of Flash, but still has a way to go.
Looking at these as a list, they may not seem like a big deal. Who cares if you can shave a few milliseconds off the time it takes you to write a line of code? How hard is it to add an import statement yourself? What’s wrong with writing an event handler function on your own?
This is missing the point. See, all of these tasks are tedious; they’re gruntwork, not programming. Automating and streamlining them frees you up to just code, without having to think about writing code. The FlashDevelop user interface helps out in the same way: it feels a lot easier and faster to use than Flash Professional’s (which is not surprising, since it’s based on Visual Studio‘s excellent UI).
FlashDevelop has plenty of other features, and since it’s open source the community often creates more plugins and extensions, giving it even more functionality. You can also alter the settings to make it follow your own coding conventions, to put you at ease.
Now you’ve seen what FlashDevelop can do, let’s look at how to get started.
Installing FlashDevelop
You can install FlashDevelop the way you would any other Windows application. First, download the latest installation file from the relevant thread on this forum. There’s always a direct link to the download page on the FlashDevelop homepage, as well.
Once you’ve downloaded it, simply run the EXE and follow the instructions to install. If it asks you whether to install the Flex SDK, say yes.

FlashDevelop is not currently supported on any other platform but Windows, unfortunately, but it is possible to run it on Mac OS X using Parallels. See this forum thread for more details.
EDIT: Mac/Linux support is coming.
You should also install the latest Java runtime and the latest debug Flash Players.
When you first run FlashDevelop, it’ll look something like this:

It may not look exactly the same, since I’ve customized the layout of mine, but it’ll have the same basic elements. You can choose which panels to show by selecting them in the View menu, and drag them around the UI to lay them out as you please. Move them to an edge of the window to make them snap to that edge. Some panels have a “pushpin” icon; clicking this toggles auto-hide, where the panels will slide out of view when not in use, and reappear when you hover over their icon.
There are three main ways to use FlashDevelop:
- Completely on its own, with no need for Flash Professional
- Alongside Flash Professional, using Flash CS3+ to export assets while FlashDevelop handles the overall project
- As a code editor, using Flash Professional to manage and compile the project
Different workflows will be suitable for different people. If you’re already using Flash Professional for all your projects, you’ll probably find it easiest to keep doing that but switch to FlashDevelop as your main code editor (Option 3). If you don’t own Flash Professional — perhaps you’re new to Flash — you might as well start by using FlashDevelop on its own (Option 1). If you’re a coder and you work with a designer who uses Flash Professional for layout and animation, then using the two tools side by side will give you each what you need (Option 2). The three workflows produce slightly different projects, so if you work with other programmers, make sure to check what’s acceptable with them before you potentially cause a mess.
Personally, I started with Flash Professional on its own, then quickly switched to Option 3, and now I use either Option 1 or 2 for my own projects (as appropriate), and occasionally need to use Option 3 for freelance work. It’s definitely worth knowing all three of them, so we’ll go through them in turn.
Option 1: FlashDevelop Alone
In this workflow, you don’t need a copy of Flash Professional; you’ll use FlashDevelop to write all your code, import and embed all your assets (graphics, sounds, and so on), and compile your project.
Setup
For FlashDevelop to be able to compile a Flash project, you’ll need to install the free Adobe Flex SDK. There’s a little confusion about this, so let me clear it up: using the Adobe Flex SDK does not mean that you need to use the Adobe Flex framework or MXML; nor does it mean that you have to use Adobe Flex Builder (now called Adobe Flash Builder). At this stage, you can think of the Adobe Flex SDK as just a tool that lets FlashDevelop turn your code into an actual Flash SWF file.
With luck, you’ll have installed the Flex SDK as part of the FlashDevelop installation process. If so, skip to the Creating a New Project section. Otherwise…
- Download the “latest production quality release” from the Flex SDK homepage. (Get the version labeled “Adobe Flex SDK” or “Free SDK” rather than “Open Source Flex SDK”.) Unzip it somewhere on your hard drive; place it somewhere generic, rather than in the folder for one specific Flash project.
- Now, in FlashDevelop, click Tools | Program Settings and select AS3Context from the list on the left. In the Language | Flex SDK Location section, click the text box and then click the button marked “…” which appears. You’ll be given a file browser dialog; use it to navigate to the root folder of the Flex SDK. (This is the folder that contains the subfolders called “ant”, “asdoc”, “bin”, and so on.
- Next, still in Program Settings, select FlashViewer from the list on the left. In the Misc | External Player Path section, browse to \runtimes\player\10.1\win\FlashPlayer.exe within the root folder of the Flex SDK. (This is correct at time of writing, when Flash Player 10.1 is the latest version. In the future, this may change.)
- Close the Program Settings.
- Click Tools | Flash Tools | Documentation Generator | Settings and set the ASDoc Location to the \bin\ directory within the root folder of the Flex SDK.
- Click Save Settings, then close the ActionScript Documentation Generator window.
There are other ways to configure the Flex SDK; check out this section of the official wiki for more details.
Creating a New Project
FlashDevelop is now ready for you to use. Create a new project by clicking Project | New Project…. The following dialog will appear:

Which to choose? Well, “Flash IDE” refers to Flash Professional, so we can’t use that. The AIR Projector projects are all for creating standalone AIR applications, rather than SWFs that can be run in a webpage, so ignore those. “Flex 3 Project” and “Flex 4 Project” sound likely, since we’re using the Flex SDK, but these are for projects that use a Flex Framework, rather than just the Flex SDK. That’s useful for some projects, but not necessary, and beyond the scope of this tutorial.
The choice is between “AS3 Project” and “AS3 Project with Preloader”; they are the same, except that the latter option includes all the basic code and setup required for a loading screen. Select “AS3 Project with Preloader”, then enter a name for your project, and select a location for the files to go.
Three folders will be created: bin, lib, and src.

For more information on these, check out Daniel Apt’s Quick Tip: How to Organize Your Flash Project Files. Put briefly: code files go in \src\, SWF files get output to \bin\.
Testing the Project
If you load \src\Preloader.as, you’ll see several // TODO comments, marking points where you can add your own code for showing, updating, and hiding a custom loader. Once the entire project has loaded on the user’s computer, the startup() function will be run; this will create a new instance of the \src\Main.as class, so let’s take a look at that:
package
{
import flash.display.Sprite;
import flash.events.Event;
/**
* ...
* @author MichaelJW
*/
[Frame(factoryClass="Preloader")]
public class Main extends Sprite
{
public function Main():void
{
if (stage) init();
else addEventListener(Event.ADDED_TO_STAGE, init);
}
private function init(e:Event = null):void
{
removeEventListener(Event.ADDED_TO_STAGE, init);
// entry point
}
}
}
Without going in to too much detail (see this Quick Tip for a little more explanation on what’s going on in this class), the // entry point comment is what’s important here. This marks the spot where all the code and assets are fully loaded and has started to run.
We can test the project by adding a simple trace() statement immediately after this line, like so:
package
{
import flash.display.Sprite;
import flash.events.Event;
/**
* ...
* @author MichaelJW
*/
[Frame(factoryClass="Preloader")]
public class Main extends Sprite
{
public function Main():void
{
if (stage) init();
else addEventListener(Event.ADDED_TO_STAGE, init);
}
private function init(e:Event = null):void
{
removeEventListener(Event.ADDED_TO_STAGE, init);
// entry point
trace("Project is running fine!");
}
}
}
Click Project | Test Movie and FlashDevelop will compile the code into a SWF, then run that SWF. The Flash Player window will appear:

…but it’ll be blank, because we haven’t told it to display anything. However, check the Output panel within FlashDevelop (click View | Output Panel if it’s not already visible):

Great!
Embedding Assets
In Flash Professional, we can add images and sounds to a Flash project by dragging them in to the library, and refer to them in code by setting their Linkage properties within the library. In FlashDevelop, the process is a little longer; here’s a quick overview:
Let’s suppose you have a JPEG, and you want to display it within the SWF. First, move it to the \lib\ folder. Then, in the Project panel, right-click the image and select “Add to Library”:

The image’s filename will turn blue to indicate that it is now in the library.
In Main.as, above the constructor function, add this line:
public class Main extends Sprite
{
public var ActivetutsLogo:Class;
public function Main():void
{
if (stage) init();
else addEventListener(Event.ADDED_TO_STAGE, init);
}
(Of course, you should call this class something relevant to the image file that you’re using, rather than ActivetutsLogo.)
We’ll use this class to contain the image file itself, as a Bitmap. To link the two together, insert a new blank line above public var ActivetutsLogo:Class;, move the cursor to it, right-click the image in the Project panel again, and select “Insert Into Document”. A new line will be added to the class:
public class Main extends Sprite
{
[Embed(source='../lib/Activetuts.jpg')]
public var ActivetutsLogo:Class;
public function Main():void
{
if (stage) init();
else addEventListener(Event.ADDED_TO_STAGE, init);
}
You’ve now defined ActivetutsLogo as a class that extends Bitmap and contains the image. (It’s important that the [Embed] tag is on the line immediately above the line that declares the variable; that’s how Flash knows that the two are linked.) Now you can display the image in the SWF. To do so, move to the init() function, below the trace() statement you added earlier, and add these lines:
private function init(e:Event = null):void
{
removeEventListener(Event.ADDED_TO_STAGE, init);
// entry point
trace("Project is running fine!");
var activetutsBitmap:Bitmap = new ActivetutsLogo();
addChild(activetutsBitmap);
}
Run the project (Project | Test Movie) and you should see your image inside Flash Player:

Success! Follow the same basic steps to embed other types of assets, like music. See this section of the Flex documentation for more details.
Now, if you’re completely new to Flash, all that talk about classes and whatnot probably went over your head. Don’t worry! This is a guide to FlashDevelop, rather than to Flash or AS3, so I’ve skimmed over some of the details. You can pick them up from other Basix tutorials on the site.
Option 2: FlashDevelop with Flash Professional Assets
This workflow is ideal if you’re working with a Flash designer or animator who uses Flash Professional to create their assets. It essentially lets you embed the libraries from one or more FLAs inside your FlashDevelop project.
Creating a New Project
Create a new project following exactly the same instructions as for Option 1, but ignore the Embedding Assets section. You can embed assets using that method if you prefer, but you don’t need to.
Open Flash Professional. I’m using Flash CS3, but any version above that will work, too. Create a simple movie clip, which in turn contains some other movie clips; I’ve created a basic menu using a gradient background and some buttons made with my Buttonizer panel:

Give the menu symbol a linkage name of SimpleMenu. Inside the symbol, give each button a relevant instance name (I’ve gone for startButton, stopButton, and infoButton).
Save the FLA in your project’s \lib\ folder. Now, still in Flash Professional, click File | Publish Settings…, click the Flash tab, and check the “Export SWC” box. In the Formats tab, uncheck every box apart from Flash. Press OK, then click File | Publish. Your \lib\ folder will now contain a FLA, a SWF, and a SWC.
Adding the SWC to your FlashDevelop Project
The SWC is the key to this workflow. It’s a file that contains the library of the FLA, in a format that FlashDevelop and the Flex SDK can read.
(Okay, technically it doesn’t necessarily contain the whole library, as you can force certain symbols not to be exported by changing certain settings — but that’s not important right now.)
Switch to FlashDevelop and right-click the SWC in the \lib\ folder. Click “Add to Library”.

So far, it’s just like embedding a JPEG, right? Well, this is where things change. First, check out what happens if you click the little plus sign next to the SWC:

We can see all the classes available to the FLA, and all the symbols that were given a linkage name. The buttons aren’t there, but don’t worry.
Let’s add an instance of the menu to the SWF. Add two new lines immediately after the trace() statement that you added earlier:
private function init(e:Event = null):void
{
removeEventListener(Event.ADDED_TO_STAGE, init);
// entry point
trace("Project is running fine!");
var menu:SimpleMenu = new SimpleMenu();
addChild(menu);
}
Run the project:

Excellent. We’ve managed to take the menu straight from the SWC file, add it to a separate Flash project, and display it in that project’s SWF.
As you can see, the buttons remain in the menu, even though we can’t see them inside the SWC file. This is because the buttons are inside the SimpleMenu object; we still have complete access to them via FlashDevelop, albeit only through the SimpleMenu. This comes in very handy — for example, immediately below the two lines of code you just added, type menu.button:

Assuming you named your buttons in a similar fashion to mine, you’ll see that they all exist as properties of the menu object, because we gave them instance names. This means that we can access everything from the SWC via code, like so:
private function init(e:Event = null):void
{
removeEventListener(Event.ADDED_TO_STAGE, init);
// entry point
trace("Project is running fine!");
var menu:SimpleMenu = new SimpleMenu();
addChild(menu);
menu.startButton.addEventListener(MouseEvent.CLICK, onClickStart);
menu.stopButton.addEventListener(MouseEvent.CLICK, onClickStop);
menu.infoButton.addEventListener(MouseEvent.CLICK, onClickInfo);
}
private function onClickStart(a_event:MouseEvent):void
{
//do something
}
private function onClickStop(a_event:MouseEvent):void
{
//do something else
}
private function onClickInfo(a_event:MouseEvent):void
{
//do a third thing
}
This separates the FLA from the code. The designer could completely overhaul the graphics, and as long as there’s a SimpleMenu symbol containing a startButton, a stopButton, and an infoButton, the project will still work. Plus, the project can contain multiple SWCs; when building a game, one designer could work on a User Interface FLA containing menu layouts, while another works on a different FLA containing character animations. Backgrounds could be high-res JPEGs, added to the project using the [Embed()] tag. It’s a great workflow.
For more information on SWCs, check out this tutorial.
Option 3: FlashDevelop as Flash Professional’s Code Editor
The third workflow is the simplest. In this scenario, FlashDevelop is used merely as an editor for the AS files of a Flash Professional project. You still get most of the benefits of FlashDevelop’s features (code completion, automatic imports, and so on), but are reliant on Flash Professional for compiling the project and maintaining the library.
Creating a New Project
It’s very simple to create a project for this workflow. In FlashDevelop, click Project | New Project and select Flash IDE Project.

Pick a blank folder and give the project a name. Then, inside that project, create a new FLA.
That’s it! Set up your folder structure however you like, and don’t forget that even though you’ll be using FlashDevelop to edit all your classes, you’ll still need to link your document class to your FLA.
When you run the project in FlashDevelop, it’ll switch to Flash Professional and publish the SWF. You should still be able to receive the output of trace() statements in FlashDevelop’s Output panel.
Using FlashDevelop for an Existing Project
If you’ve already started a Flash Professional project without FlashDevelop, you can still use FlashDevelop as your main code editor. Follow the same steps as above, by creating a new Flash IDE Project within FlashDevelop, but instead of selecting a blank folder, select the folder where your FLA and other project files are located. You’ll be given a warning:

…but you can safely ignore this; FlashDevelop won’t overwrite any existing files (unless you already have a FlashDevelop project in that folder). Click OK, and you’ll get the same result as if you’d been using FlashDevelop from the start of the project.
Donating
FlashDevelop is completely free and open source. This is made possible by donations, so if you find it useful, consider sending the team a few dollars. They are currently doing a donation drive while gearing up for Version 4.0, so I’m sure whatever you can give would be extra-appreciated right now.
Any Thoughts?
That covers the basics, but I know there’s a lot more to FlashDevelop. What essential features and plugins have I missed out? Please share in the comments :)

Hands down the best as3 code editor out there.
‘Nothing like brushing up with my weapon of choice…hehe
Excellent tut Michael. =)
Thanks John! It’s my “weapon of choice” too ;)
one of the best editor to work with flash..makes the development process more simple ..thanks to the FD team
Totally agree :)
Defiantly the best AS code editor out there.
My favourite keyboard shortcut for it is CTRL + SHIFT + 1. If you are going to create a function just write the function name that you are going to call
eg. myFunction(); then just press CTRL + SHIFT + 1 and it will generate that function for you. The shortcut works for a whole heap of other things too. Give it a try and I promise it will save you SO much time.
Ah yes, this is brilliant — thanks for sharing, Ed!
Great rundown, MJW! i adore FlashDevelop, and use it daily. i’m actually talking to a colleague about it this afternoon, and i think i can save a lot of time by just forwarding him this link :)
FD’s productivity enhancements run very deep. Here are a few other things it does that you missed (and i’m sure other folks will chime in with more.)
CODE SNIPPETS
Press CTRL+B to bring up the snippets list of common code blocks, including for loops, forins and else ifs. You can customize this list, which is awesome, because i always write my for loops a very particular way. In the snippet editor, you can even specify where the caret will appear after pasting the snippet.
WARPING AROUND YOUR CODE
One of the most useful things about FD for me is the F4 key, especially when poring over another programmer’s needlessly complicated code. Just click on a function call and press F4, and FD will warp you down the page to where that function is defined. It even works when the function is a method of another class – FD will open that class in a new window and warp you to the definition.
It also works with properties/fields … point to one of those and hit F4, and you’ll bounce up to the top of the class where the field is declared.
VARIABLE PROMOTION AND FUNCTION DEFINITION
CTRL+SHIFT+1 is another of FD’s magic keystrokes. You pointed out how it can create an Event callback, but did you also know it will create a function for you out of thin air?
If you call a non-existent function like this:
doSomething();
and CTRL+SHIFT+1 it, FD will create the definition:
private function doSomething():void {
}
Hot damn!
If you CTRL+SHIFT+1 a variable declaration, FD will promote it to a class member.
Try typing this inside a function:
var myVar:String = “hello”;
and then CTRL+SHIFT+1 it.
COLOURED TRACE ACTIONS
Just found out about this one this week, and have been abusing it. If you preface a trace action string with a number and a colon, the output will trace out with a different colour:
trace(“3: Hello”);
i think it takes 0-4 as input?
OUTLINE PANEL
Again, while going through someone else’s crazy complicated code, i’m getting a lot of use out of the OUTLINE panel, which lists a class’s methods and properties. You can click each one to warp directly to it.
SHARED OBJECT READER
FD comes with a built-in shared object reader for reading Flash *.sol files (“Flash Cookies”). It doesn’t allow you to modify the shared object – you can only inspect it. Still, it’s quite useful.
There’s lots, lots more that FD does to save you time and money – these are just a few things that i’ve found useful. i hope other readers pop on and share more stuff, because i’m all about productivity tricks.
- Ryan
Whoa, thanks for all these, Ryan!
I totally forgot about the code snippets. Not sure how — I used to use those all the time, very helpful :)
Speaking of F4, did you know that after pressing F4, Shift-F4 will take you back to where you were before?
There’s a bunch of things Ctrl-Shift-1 can do that I wasn’t aware of until writing this: import classes based on class name; auto-create private class-level vars for each parameter in a function; create stub functions based on interfaces.
Ooh yeah, I saw the coloured trace tip floating around on Twitter this week (maybe even from you?). Neat.
The outline panel is wonderful. Did you know that you can re-order the contents based on different criteria? I find this very useful as I never get around to rearranging the code itself.
I didn’t know about the Shared Object reader; that sounds very useful, thanks :)
This is great, i use flash develop, but dont really know what im doing to be honest. I may aswell be using notepad. This article will be very helpful to me. Thanks
Surprised to see you say that Ben! Cheers :)
Also don’t forget color schemes! so your code can look more fancy :P http://www.flashdevelop.org/community/viewtopic.php?f=20&t=2860
Oh, nice! Should help reduce eye strain too :)
Great post about a superior editor!
FD beats all editors I tried, regardless of language. Code completetion is even better than VS, and despite all the features it still feels very lean.
I think the debugging and profiling features are worth a mention as well. It’s great to be able to mouse-over a variable to see it’s value at a breakpoint or when an exception occurs, and the profiler used to be the only thing I felt was missing compared to FlashBuilder.
Also the snippets and templates are extremely useful, as well as the newly added integration with version control systems.
Thanks Leo! Good point about the debugging. I did have information about them in an early draft of this article, but figured they were more suited to power users rather than beginners. We’ll do a Quick Tip explaining how to use the debugger and profiler in the future — anyone interested in writing that?
I’m actually not that impressed with the Git integration. Maybe it’s improved since the version I tried, but I found it to be very glitchy. I prefer TortoiseGit; ctrl-right-click on the project name in your Project panel and it’ll open the shell menu, where you can access all the TortoiseGit controls.
Oh! Another great thing about code complete …
If you have a class that inherits from another class, and you want to override a method on the parent called doSomething, just type this:
override doSomething
Once you hit the space bar, it automagically changes your code to this:
override public function doSomething(somethingToDo:String):void
{
super.doSomething(somethingToDo);
}
Phenomenal! i usually can’t be arsed to check the exact method signature on the parent, and i always get some small thing wrong. FD sorts it all out for you.
- Ryan
I love that! That’s what made me switch from
public override function ...tooverride public function ...Thats awesome!!!
Glad someone chimed in with the shortcuts, that’s surely one of its strongest points! Can the article be updated, I might write some tuts which use FD and would be nice to send readers to this first to be familiar with it…?
That’d be awesome, MSFX, thanks :) I’ve added a note to the “Automatic Object Creation” section to say that Ctrl-Shift-1 can do so much more, but I want to avoid going into detail for fear of bloating the article (that’s why I forced myself to stick to just six features in the first place).
I do plan to keep this updated as FlashDevelop changes in the future, though — should be seeing Version 4 soon!
Ah, yes FlashDevelop. The best of the best. I tried FDT after using FlashDevelop, and FDT just seemed clunky to me. The only things I really envied from FDT is the complete control of white space (where it should go, where it shouldn’t go) and the snippets, particularly the variables within the snippets. I know they aren’t much different from FD’s snippets, (FD even has some variables that FDT doesn’t) but it’s really nice to see where the variables actually fit in the snippet.
Hey Kronoshifter, I’m not very familiar with FDT; what do you mean about its control of white space?
Any recommendation of an alternative the the Flash IDE if you are on Mac (one similar the FlashDevelop) ?
I’ve never found a decent answer to this, and (as I don’t own a Mac) I can’t check it out myself.
These two posts by 8bitrocket are the best I’ve seen on the subject:
Help Me Find a Good AS3 IDE on the Mac
The Mac/FlashDevelop/Parallels Decision (sort of)
If anyone has any experience or recommendations here, please speak up!
wow.. Flashdevelop, looking forward to see tutorials on active.tutsplus.com… Tutsplus rocks!
Great news! Mac/Linux support for FlashDevelop has just been announced. Alpha-quality builds are available at that link.
Great introduction Michael. I needed to get my head around the whole Flash, SWC, Flash Develop tie in and you summed it up pretty well. Thanks.
Thanks, Benjamin :)
I’ve created my very first game in FD for a assignment of school. And aldo at first i didn’t really liked how i had to create something in Flash, and then import the SWF and assigned specific vars to vector images, it still beats Flash!
Great job, Michael! You saved me a lot of typing =) I won’t need to talk about the details of working in FD in my next tut :)
Excellent! That was part of my goal :)
I’ve only been using as3 since last fall and I’m coming from a C++ background. I am so glad I found your article. It is a huge help and I’ve just switched to using flashDevelop for my projects. Thanks so much. I will also tune in for any advanced articles. Keep it up.
Glad to hear it, JZ :) Thanks for your comment!
Evening All,
Very nice tutorial -FlashDevelop is indeed mui good.
Yet I’m at the possibly most basic of stumbling blocks: I’ve got my crappy image, and I need to share it with the world -eg. I need to make it so that other people outside of FlashDevelop, with their own flash players, can click on it and view it. But how?
Testing the movie sure brings it up, but thats only for me: how for example do I e-mail it to someone and they can view it with only flash player? I’ll hunt around some more, but any thoughts/solutions are more than welcome!
Hi ReaperOscuro,
If you’ve followed the instructions above, then you should find a .SWF file in your projects
\bin\directory; you can email this to someone and they’ll be able to play it with Flash Player.However! When you install FlashDevelop, you’ll also install the standalone Flash Player, which lets you run SWF files on the desktop. Most people don’t have this standalone Flash Player installed; they only have the Flash Player plugin for their browser. So, you can either get FlashDevelop to generate an HTML file along with the SWF (and they’ll be able to open the HTML file in their browser and see the SWF), or you can simply tell them to open the SWF with their browser. Make sense?
Evening Michael,
Thank you very much for your reply. I assumed it was something nice and simple as such, but for the life of me couldn’t locate it.
Here is the interesting (to me) thing: indeed opening the swf with browser opens the file -well, after you allow the activex content of the flash player plugin.
However if I use the html (I assume that the index.html file alongside the swf is the one you are referring to) it opens a page in the browser, which is blocked unless I activate the activex -and here is the interesting part: once I activate it, the page goes blank. However prior to activating it the page has written the name of the project, underneat it “alternative content” and underneath that a logo-link to downloading flash player 10.3.
Regardless, it was the swf file I really needed -need to give it to the website designers to integrate- so that solves that problem. Thanks a million Michael, I’ll be sure to accredite you in the games credits!!
That’s awesome! Send me a link when it’s done, please :)
Hi Michael,
Good work. Can you help me about, if I want to load an existing .swf file for sprite animation and play it from any particular frame, what/how should I do it using FD. Thanks a lot.
Hey, sorry Emdad, I missed your comment somehow! If you still need help on this, look into the flash.display.Loader class.
As far as I can tell, the “Add to Library” step doesn’t do anything useful. The project seems to compile and run just fine whether you do this step or not.
What is “Add to Library” supposed to accomplish?
When using a SWC (Option 2), “Add to Library” lets you reference classes from the SWC in the project, and to allow auto-completion of the class names.
For a JPG or other such asset, it’s not strictly required, but I think it allows auto-completion (?) — I might be wrong.
Thanks for the tutorial.
I have some experience using AS3 with Adobe Flash while at school, but now that I am at home (and finding myself without a usable copy of Flash) I am very glad to have found out about FlashDevelop, and even more glad to have found a simple and usable tutorial to get me started. Thanks a lot!
Hooray for FlashDevelop! Glad you found this useful :)
If anyone gets an error about unknown bitmap type at the Embedding Assets step after copying and pasting the sample code, do the following:
1. delete :Bitmap
2. retype the colon
3. select flash.display.Bitmap from the popup list
It should be working if the word Bitmap turns green.
I would like to know how to pack an app into an *.air file using FlashDevelop. If someone can help.
As far as I know, you can’t convert an existing AS3 project to an AIR project. You would want to start by selecting one of the AIR project templates from the “New Project” menu. As of FD4, the available options are “AIR Flex 3 Projector”, “AIR Mobile Flex App”, “AIR Flex 4 Projector”, “AIR AS3 Projector”, and “AIR Mobile AS3 App.”
This will automatically create certain files that you’ll need to package an .air file.
From there, you would develop your app as you normally would (possibly making use of some AIR-specific functionality). If you have already developed your app in another project, you can simply copy your source files from the old project into the new AIR project.
When you are ready to package your app, you can follow the instructions in the AIR_readme.txt file that was placed in your project’s directory:
1. Configuration
- edit ‘bat\SetupSDK.bat’ for the path to Flex SDK
2. Creating a self-signed certificate:
- run ‘bat\CreateCertificate.bat’ to generate your self-signed certificate,
(!) wait a minute before packaging.
3. Run/debug from FlashDevelop as usual (build F8, build&run F5 or Ctrl+Enter)
4. Packaging for release:
- run ‘PackageApp.bat’ to only create the AIR setup
Note: You will need an internet connection to run CreateCertificate and PackageApp
Hope this helps!
Feels like I have just started REALLY using Flash after 4 years thinking that I was. Spent the day searching for an as3 editor when I discoverd that autoformat was adding, changing and could even completely break the code. Thanks for Flash Develop is just too small a praise phrase so I will donate!
Totally splendid.
Paul
Excellent!!
I´m a newbie and this made me understand a lot more!
Now I will check if there is more on tutplus.
Regards
TompaD
So, to create the fla/swc files you need Flash Pro & the only part of this tutorial you can do without Flash Pro is the part where you display an image in a window?
“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.”
Yet another timewaster. I’m starting to doubt that FlashDevelop can do any more than say “Hello World” in text and images.
http://blog.log2e.com/2008/05/07/creating-a-swc-component-in-flashdevelop/
Not really, you can package your source code into a .swc format. Of course, Flash being a tool for drawing vector graphics will be able to include those graphics you draw into the .swc file. For FD, its just text file and images you edit from an image editor, like Photoshop.
Hi,
Is FlashDevelop more mature than Flash-builder 4.6 ?
Excellent tutorial, thank you. Haven’t found anything on the web that compares to the quality and clarity here.
Thanks John!