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/Flex2

  • Install Flex 2 SDK .
  • Follow these directions, summarized below:
    • In proram settings, set ASCompletion.Flex2SDK.Path to the root folder of the flex2 SDK install
    • Download intrinsic classes (mirror) and extract somewhere. Add to global classpath.
    • Remove all references to Macromedia in Global Classpath
    • Download as3_toplevel, extract somewhere. Set ASCompletion.Macromedia.Classpath to the folder containing toplevel.as
    • Set ASCompletion.MTASC.UseStdClasses to false.
    • (only for mxml: put xml file from this zip into FlashDevelop/Data)
  • To compile, add a @mxmlc tag to the very top of your main AS file. More info on @mxmlc tag. Example:
/**
* @mxmlc -sp+=G:davidrpapervisionas3src
*/
  • NOTE: Make sure the entire @mxmlc string is on one line only
  • Press Ctrl+F8 to compile & run!


Setting SWF properties etc

  • Simply add this code right above your main class definition:
[SWF(width=“800″, height=“600″, backgroundColor=“#ffffff”, frameRate=“30″)]

public class MyMainClass extends Sprite
{


Intro to AS3 Tutorials


PaperVision3D


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 {

  [Embed(source=“logo.png”)]
  public var Logo:Class;

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

}
Filed under: Uncategorized — 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 1084 access attempts in the last 7 days.