Search code examples
actionscript-3airmovieclipaddchild

How do I add MovieClips to the stage while using AIR?


So I had been messing around in AS3 for awhile and had done some basic starting flash game things, but then found out I could use air to make them for mobile platforms. So I tried copying over what I had worked on before, but I am running into issues.

Right now I am just trying to find out how to add an instance of a MovieClip to the stage. I have an image converted to a MovieClip with it's own class so I can manipulate it later (such as moving around) and I have this in my Main class:

class Main extends MovieClip
{
    var space:Background;  //Background is the MovieClip

    function Main():void
    {
        space = new Background(stage);
        stage.addChild(space);
    }
}

But when I run the program, the image doesn't show up. It works that way when I just had a standard AS3 program and I don't understand why it would be different when I am trying to use AIR. Any assistance would be greatly appreciated, thank you.


Solution

  • Rajneesh Gaikwad had the answer, I didn't have my Main class as my Document class.