Robots w/Lasers

February 21, 2007

AS3 Quickstart

This is a quick reference I wrote for getting started in writing Actionscript3 / Flash9 applications, using all free tools. Note that this is aimed at Windows users (FlashDevelop (the IDE) is a windows-only tool). Later I will write a version aimed at Linux users (The Flex 2 SDK (the actual compiler) is written in cross-platform Java).

FlashDevelop + AS3/Flex3

  • Install Flex 2 SDK
  • Follow the installation instructions from the download page. The summary is below, but may be out of date:
    • Download Flex 3 SDK – You want “Adobe Flex SDK” – Get “Milestone” for production code, “Stable” for some newer updates that is reasonably stable, and “Nightly” for alpha code with the latest features
    • After unzipping somewhere, go to Tools→Program Settings→AS3Context→Flex SDK Location and set the path
  • Do Project → New Project… and pick an Actionscript 3 project. To compile & run hit F5, to compile only hit F8. trace()'s will go to the Output window if you compile in Debug mode.
  • Check out the neat auto code generator – in a nutshell, put your cursor on something and hit ctrl+shift+1 (see link for details on what places it works)

Intro to AS3 Tutorials


Embedding assets in AS3

  • You can easily embed assets using the [Embed()] tag in your .as files.
  • NOTE: The path to the assets is relative to the .as file!
public class Main extends Sprite { 
  public var Logo:Class; 

  public function Main() { 
    var logo:Bitmap = new Logo(); 


Hello World

  • AS3 Hello World

    package { 
    	import flash.display.Sprite; 
    	import flash.text.TextField; 
    	[SWF(width="800", height="600", backgroundColor="#ffffff", frameRate="30")] 
    	public class HelloWorld extends Sprite { 
    		public function HelloWorld() { 
    			var display_txt:TextField = new TextField(); 
    			display_txt.text = "Hello World!"; 
  • MXML Hello World
    <?xml version="1.0" encoding="utf-8"?> 
    <!-- @mxmlc -default-size 400 300 --> 
    <mx:Application xmlns:mx="" layout="vertical" > 
    		import mx.controls.Alert; 
    		public function doAlert():void {"You clicked the button!", "Hello Alert"); 
    	<mx:VBox horizontalAlign="middle"> 
    		<mx:Label text="Hello World"/> 
    		<mx:Button label="click me!" click="doAlert()"/> 
Filed under: — davr @ 1:51 pm

1 Comment »

  1. […] & licensing – Own It Flash Tutorials | FlashGuru Consulting Vectors for Flash Tile based games Robots w/Lasers » AS3 Quickstart Asual » […]

    Pingback by FlashBrighton » Blog Archive » Flash Links — November 20, 2007 @ 6:09 am

RSS feed for comments on this post. TrackBack URI

Leave a comment

Powered by WordPress

Bad Behavior has blocked 643 access attempts in the last 7 days.