as3 this.graphics calls do nothing
- by zzz
class A:
[SWF(width='800',height='600',frameRate='24')]
public class A extends MovieClip {
private var b:B;
public function A(){
super();
b = new B();
addChild(b);
addEventListener(Event.ENTER_FRAME, update);
}
private function update(e:Event):void {
b.draw();
}
}
class B:
public class B extends MovieClip {
public function draw():void {
//! following code works well if put in constructor, but not here
this.graphics.beginFill(0xff0000);
this.graphics.drawCircle(200,200,50);
}
}
this.graphics calls do nothing in draw method, but work fine inside B`s constructor, what i am doing wrong ?