Q:

Simple question about positioning class-created display objects in actionscript 3

Take this class:
    package  {
    import flash.display.MovieClip;

    public class test extends MovieClip {

        public function test(parentMC) {
            var s=new MovieClip()
            s.graphics.lineStyle(1,0x000000,1)
            s.graphics.drawCircle(200,200,100)
            parentMC.addChild(s)
        }

    }

}

Why does the following code not move the created circle and how can I make it do so?
var s=new test(stage)
s.x=500

Thanks!

A:

Try this instead: 
package  

{
    import flash.display.Sprite;

    public class Test extends Sprite   
    {

        public function Test() 
        {
            graphics.beginFill(0xFF0000);
            graphics.lineStyle(1,0x000000,1);
            graphics.drawCircle(200,200,100);
            graphcis.endFill();

        }// end function

    }// end class

}// end package

and implement it like this:
var test:Test = new Test();
test.x = 500;
addChild(test);

The problem was that you weren't adding the Test's class's local display object (in the Test class's constructor) to the Test display object container, you were adding it to the parentMC display object container. 

