Skip to content

Instantly share code, notes, and snippets.

@buckle2000
Created May 12, 2016 06:49
Show Gist options
  • Save buckle2000/fd74fd6a164ca2c895f87151c1d07568 to your computer and use it in GitHub Desktop.
Save buckle2000/fd74fd6a164ca2c895f87151c1d07568 to your computer and use it in GitHub Desktop.
The minimal project which will cause a bug
package;
import openfl.display.Sprite;
class Main extends Sprite {
public function new () {
super ();
addChild(new NewClass());
}
}
package;
import openfl.display.Shape;
import openfl.display.DisplayObjectContainer;
class NewClass extends DisplayObjectContainer { // the same bug will occur if you change parent class to `DisplayObject`
public function new() {
super(); // note that the contructor of `DisplayObjectContainer` is private, so does `DisplayObject`
var a = new Shape();
addChild(a);
a.graphics.beginFill(0xff234567);
a.graphics.drawCircle(0, 0, 100);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment