This steps to make Hello World using Flixel
- Run Flash Develop
- Start a new project by going to: Projects -> new Project...
- When a window appear choose AS3 Project. Give it name Testing Flex Compiles
it will create 3 folders bin (this the swf will be compiled), lib (external compiled library files here, such as SWCs, don’t put AS3 source code here), src (source folder).
- Copy org folder from flixel to src
- Expand src and open Main.as
Change with
package
{
import org.flixel.*;
//To set swf width, height, and backgroundColor
[SWF(width="400", height="300", backgroundColor="#000000")]
//To Make Preloader
[Frame(factoryClass="Preloader")]
public class Main extends FlxGame
{
public function Main()
{
//To set flixel width, height, state, and zoom
super(320, 240, PlayState, 2);
}
}
}
Make new AS3 Document by going to: File ->New->AS3 Document
Fill with
package
{
import org.flixel.system.FlxPreloader;
public class Preloader extends FlxPreloader
{
public function Preloader()
{
//To set FlxGame
className = "Main";
super();
}
}
}
save as Preloader.as
Make new AS3 Document
Fill with
package
{
import org.flixel*;
public class PlayState extends FlxState
{
override public function create():void
{
add(new FlxText(0, 0, 100, "Hello World"));
}
}
}
save as PlayState.as