如题:
我在creator中用object-c调用js方法提示找不到类,求大神指点!!具体代码如下:
js类代码:
var HelloWorld = cc.Class({
“extends”: cc.Component,
name: “HelloWorld”,
properties: {
label: {
“default”: null,
type: cc.Label
},
text: ‘Hello, World!’
},
statics: {
staticNode: null,
testCall: function testCall(str) {
HelloWorld.staticNode.label.string = str;
}
},
onLoad: function onLoad() {
this.label.string = this.text;
HelloWorld.staticNode = this;
},
update: function update(dt) {}
});
object代码:
ScriptingCore::getInstance()->evalString(“HelloWorld.testCall(‘testxxxx’)”);
错误提示为:
ScriptingCore::evalString:1:ReferenceError: HelloWorld is not defined
不知道creator要怎么写才能成功调用呢???????求大神出现~~~~