TypeError: this.initWithTexture is not a function

Hello,
i just switched to version 3.0pre2 and got this problem using jsb.
i derive a class from cc.Sprite. In the ctor i want to initialize it with a sprite frame like this:

var Ball = cc.Sprite.extend({
	ctor:function(objScene, b) { 
		this._super();
                                 
        // SpriteFrameCache
        this._spriteFrameCache = cc.SpriteFrameCache.getInstance();
        this.initWithSpriteFrame(this._spriteFrameCache.getSpriteFrame(b.sf));

....

in version 2.2 it worked as exptected but in version 3.0 i get the error
TypeError: this.initWithTexture is not a function
does anybody know the reason for this?
thank you,
roelfsche

Nobody an idea?

I created a new project as described:
./create_project.py -n test.standalone -k com.test.standalone -l javascript -p /path/to/project/cocos-x-3-test-standalone

And i just changed the delivered example code to the following:

var Ball = cc.Sprite.extend({
    ctor : function() {
         this._super();
         cc.associateWithNative(this, cc.Sprite);
         //'test' is not valid but just for testing, if method available
         this.initWithSpriteFrame('test');
    },
    init: function() {
        this._super();
    }
});
var MyLayer = cc.Layer.extend({
    sprite:null,
    ctor:function() {
        this._super();
        cc.associateWithNative( this, cc.Layer );
    },
    init:function () {
        this._super();
        var myBall = new Ball();//cc.Sprite.createWithSpriteFrameName('test');
        return true;
    }
});
var MyScene = cc.Scene.extend({
    ctor:function() {
        this._super();
        cc.associateWithNative( this, cc.Scene );
    },
    onEnter:function () {
        this._super();
        var layer = new MyLayer();
        this.addChild(layer);
        layer.init();
    }
});

and i get the following error:
iOS.app/src/myApp.js:32:TypeError: this.initWithSpriteFrame is not a function

i checked the cocos2d-x reference (http://www.cocos2d-x.org/reference/native-cpp/V3.0beta2/d8/de9/group__sprite__nodes.html#ga9c05fe90b1b9cfb4f6081567a7486a81). the function is described there (same here: http://www.cocos2d-x.org/reference/html5-js/V2.2.2/index.html).
does anybody know the reason?
thank you,
roelfsche

Hi, initWithXXX was removed from 3.0bindings.
You could use setSpriteFrame or setXXX instead.

Hi dumganhar,
thank you for your reply. is there a document that describes the api-changes? i searched the web but didn’t find this information.
and i just checked the js-api. there is no method setSpriteFrame on class cc.Sprite or parents. this would mean, the api isn’t cross-plattform between browser and ios anymore. is that right?

I used another way to fix the errors:

initWithTexture:function(texture) { var s = texture.getContentSize(); this._rect = cc.rect(0, 0, s.width, s.height); this.setTexture(texture); this.setTextureRect(this._rect); return true; },