class Main extends Sprite
{
//This could be a class that inherits sprite.
private var currentState: State;
public function new()
{
super();
this.currentState = new State();
addChild(this.currentState);
}
}
class State extends Sprite {
private var something: Sprite;
public function new() {
super();
this.something = new Sprite();
// Will be displayed from main.
addChild(this.something);
}
}
So make the new class I want to draw with extend sprite, then do addchild from main when creating it. I will try it out, thanks very much for the help.
Another quick question, can these child states also have child states?