[Resolved]TypeError: this.ctor is undefined

[Resolved]TypeError: this.ctor is undefined
0.0 0


Hello, I’m only posting this in the off-chance that someone has enocuntered this error before and so can point me in the right direction, as I have no clue as to what’s going on:

I copied the “template” folder on v2.15 and started hacking away, then, at some point, something went wrong, and now I keep getting an error in the console claiming “TypeError: this.ctor is undefined” pointing to “cocos2d/platform/CCClass.js” line 176 which is:
var Class = new Function(functionBody);

I’ve tried to find out exactly from where this is coming from, but I have only “succeeded” in finding out that it seems to happen at some point during the creation of the my main scene or my main layer on “src/myapp.js”.

I don’t want to re-do all the work I’ve already put into it (althought it’s not that much), but if no-one’s been in this position before I guess I’ll just have to start over and be more careful as to what I touch…

PS: yeah, I know I should be posting my entire source, but I can’t do it right now and neither do I feel like making someone suffer thru my noobish code.



Could you please give me the screenshot of the error call stack?

if (prototype.ctor) functionBody += "this.ctor.apply(this,arguments)";

It will check “ctor” before calling, so I don’t know what the reason is.

Best regards


It turned out to be just a REALLY dumb mistake on my part:

The error was the following line in my code:

var actEsfumar = cc.FadeOut(1.5);

The proper use (and fix for my problem then) is:
var actEsfumar = cc.FadeOut.create(1.5);

Sorry and thanks!