How to handle with an array of CC.Sprites

How to handle with an array of CC.Sprites
0.0 0


I globally defined in a Layer class a Javascript array which is supposed to contain an array of sprites (CC.Sprites) object.
I fill the array with the sprites simply this way:

arrSprites : []
contructor: function() {
    this.arrSprites = new Array();
    this.arrSprites.push(new cc.Sprite.create(texturefile));

As I try to access in any method, not only the onTouchesMoved but in any other method with this statement an alement of the array I get the “Invalid Native object” error.
I access the spritearray this way:

mymethod: function() {
    this.arrSprites[0].setTag(10);  // Error here: Invalid native object.

What I’m doing wrong. How can I fix this ?


Well. Sorry. This problem was already discussed.
As said:
“If you only want to save node after it’s created, you should invoke this.*sprite.retain; and when you don’t need it, please call this.*sprite.release();.”