Introduction:
I wanted to make a really easy to follow tutorial on how to get started using the Flash Develop and Actionscript 3.0. FlashDevelop, is a .NET open source editor for Flash and web developers. I personally have recently switched to FD and am very impressed by the results, much faster workflow and project management. So this tutorial will to do things: quickly walk you through a typical FD installation and then how to compile your first application.
Please note: Flash Develop is WINDOWS ONLY!
Requirements:
Java 1.6+ (Download)
Microsoft.NET 2.0 Runtime (Download)
* Flash Player 9 Debugger (Download)
* Flex SDK 3.0 (Download)
* Included in Tutorial Files
Instructions:
1) Download the tutorial files and extract to your desktop.
2) Run the Flash Develop (FD) setup (Installs\FlashDevelop-3.0.0...)
3) Go through FD setup choosing all default values.
4) After FD installs COPY the Flex_SDK folder (Installs\Flex_SDK) to (C:\Program Files\Flash Develop)
5) Launch FD and it will load Start Screen
6) Select Tools > Program Settings
7) Select AS3Context on left THEN Flex SDK Location (4th down) Click and browse to your FD install folder (C:\Program Files\Flash Develop) and Choose Flex_SDK folder. [See Attached Image]
8) Select FlashViewer on left THEN External Player Path Click and browse to your Flex_SDK folder (C:\Program Files\Flash Develop\Flex_SDK) and select FlashPlayer.exe
9) Click Close and then Close FD
10) Find and Open SampleProject.as3proj (SampleProject\src)
11) After FD is open click the blue arrow on top (or hit F5) to compile the SampleProject
12) Start learning AS3 and enjoy FD
Explanation:
Sample Project Notes:
The example included will teach you three basic things: creating custom objects (SampleSquare), embedding and rending typography, and basic animation sequence with TweenLite.
package
{
// General Imports...
import flash.display.Sprite;
import flash.events.MouseEvent;
import flash.text.TextFormat;
import flash.text.TextField;
import flash.text.TextFieldAutoSize;
// Internal Library Imports...
import com.sample.SampleSquare;
// External Library Imports... (you did not write)
import gs.TweenLite;
// Begin Class
public class Main extends Sprite
{
// Embed Font
[Embed(source = "../deploy/Arial.ttf", fontFamily = "n_font")]
private var n_font:Class;
private var n_format:TextFormat = new TextFormat();
private var n_text:TextField = new TextField();
private var n_square:SampleSquare = new SampleSquare();
// Constructor Method - Adds a Custom Square (SampleSquare)
public function Main()
{
this.addChild( n_square );
n_square.x = stage.stageWidth / 2;
n_square.y = stage.stageHeight / 2;
n_square.addEventListener(MouseEvent.CLICK, rotateObj);
// n_square.addEventListener(TouchEvent.CLICK, rotateObj);
drawText();
}
// Adds Text to the Square
private function drawText():void
{
n_format.font= "n_font";
// Not Shown...
}
// Tween Square with External Library (gs.TweenLite)
private function rotateObj(e:MouseEvent):void
{
TweenLite.to(n_square, 1, {rotation:360,tint:Math.random()*0xFFFFFF});
}
}// End Class
}
Directory Structure:
- src - This is where your main source goes for your project.
- int - This is where your libraries are stored (a library you wrote).
- ext - This is where external libraries are stored (a library you DID NOT write).
- deploy - This is where all assets for a project go such as fonts, images, or video files.
Whats Next?
Next: Learn how to get started with AS3 Multitouch and Flash Develop: http://amitsarangi.wordpress.com/2009/09/23/getting-started-with-multitouch-actionscript-3-0-programming-in-flashdevelop/
Related Forum Posts
