I'm using mootools 1.6.
I based my code on their tutorial but when I try to run it, the initialize
function of my subclass is not invoked. Instead, it goes directly to the parent class' initialize
function.
I tried breakpointing inside the subclass initialize
function but it really doesn't go there. In fact, my additional functions are also undefined. It's like only the functions of the parent class are created. :(
Here's my sample code:
parent.js
var Parent = new Class({
initialize: function(){
alert("parent");
},
...
});
child.js
var Child = new Class ( {
Extends: Parent,
initialize: function () {
this.parent();
alert("child");
},
... some additional functions
});
1.) Note that they are in different js files.
2.) These files are preloaded by cocos2d-js
...
"src/controllers/parent.js",
"src/controllers/child.js",
...