Hi - I have a few bugs I believe I’ve uncovered, but I’m not sure which project is the issue (hxcpp, lime, openfl, haxe). I’m on Haxe 3.2.0, OpenFL 3.3.8, Lime 2.6.8, hxcpp 3.2.180. Also, I’m using -Dlegacy.
The first bug caused a crash on OSX. Here’s basically what I was doing:
var o = Factory.text (...) // returns an openfl.text.TextField
addChild (o);
o = Factory.sprite (...); // returns an openfl.sprite.Sprite
addChild (o);
The reuse of ‘o’ as a different type caused a null pointer exception. I solved it by using a different, new variable instead of reusing ‘o’.
Similarly, I had a crash on iOS that fired during a MOUSE_DOWN event. My function looked like this:
private function onmousedown (ev) {
if (ev.target == buttonSprite) {
// ...
}
}
But ev.target was returning null. I set the type explicitly and the crash went away.
private function onmousedown (ev : MouseEvent) {
These two seem related - loss of typing results in null. Strangely, this all worked fine under Neko.
At any rate, thanks for OpenFL!