Tutorial 2 – AS3 Setup

So you decided to give Genome2D a try. Great, lets start. First you will need any IDE supporting Flash/AS3 development. Here are a few choices:

  • Flash Builder a commercial Flash/Flex IDE by Adobe.
  • IntelliJ IDEA a commercial multi platform IDE by Jetbrains supporting multiple languages.
  • FlashDevelop a free opensource IDE supporting AS3 and Haxe.
  • FDT a commercial Eclipse IDE by Powerflasher.

As you can see there a lot of options and all of these offer trials so pick the one you like the best. Its not the topic of this article to go into detail about them, so check them out.

Next thing you will need is Adobe AIR SDK, don’t get confused even if you don’t want to make AIR games this SDK contains latest compiler, libraries as well as flash player. So get grab it.

Now you are set for Flash/AIR/AS3 development so its time to get Genome2D framework. There are multiple options how you can download and setup Genome2D.

  • SWC Binary a Haxe compiled optimized SWC to be used within AS3 projects.

Now that we have all we need create a new project and link Genome2D SWC (or sources) to it. Initializing Genome2D is a matter of few lines of code.

public function initGenome():void {
   var config:GContextConfig = new GContextConfig(stage);

   var genome:Genome2D = Genome2D.getInstance();
   genome.onInitialized.add(genomeInitializedHandler);
   genome.init(config);
}

private function genomeInitializedHandler():void {
   // Genome is initialized here and you can start
}

Thats it, welcome to the world of Genome2D and I hope you will like it.