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!
Try this instead:
and implement it like this:
The problem was that you weren’t adding the Test’s class’s local display object (in the
Testclass’s constructor) to theTestdisplay object container, you were adding it to theparentMCdisplay object container.