Search code examples
flashhaxeopenfl

Haxe / OpenFL / Flash inheritance problems


I've just started to rewrite one of projects to OpenFL. I'm using Flash ans an output now, cose it's much faster to build. The problem is that some stange things just are going on to me. I'm doing some basic inharitance stuff now, and doesn't seem to work correctly. What I did, is deleting everything. Only a couple of lines of code left and it still the same. This is what I've got exactly:

class Object
{
    var size:Float;

    public function new() 
    {
       size = 30.0;
    }
}

class Player extends Object
{
    public function new() 
    {
       super();
       var a:Float;
       a = size;
    }

}    

... and it doesnt work. It looks in flash, like player class doesnt inharite from object. I've put some breakpoint in Object's constructor, and they've never came out. Whatever I do in the base class, it's NaN in Player. When I select cpp output ie. it works as it should - no errors. Everything is inharitated correctly. What's going on? Sample projects seem to work fine. Any ideas? :(

I'm using Haxe 3.1.3, and FlashDevelop 4.6.4.1 on Win7.


Solution

  • Try use another name instead of Object, ie MyObject, BaseObject etc