How to create animation with Cocos2d-JS and CocosBuilder

Hello everyone,

cc.SpriteFrameCache.getInstance().addSpriteFrames("file.plist");

returns undefined

What to properly create animation with CocosBuilder and Cocos2d-JS ?

There are lots of use

cc.SpriteFrameCache.getInstance().addSpriteFrames

in TestJavascript.
And they work without problems. Could you provide more informations about it? A demo to reproduce it will be better. Thanks.

Ok, thanks very much for your advice!
I found great example in file Explosion.js in CocosDragonJS project. Everything works perfect!
It was my fault because I thought that addSpriteFrames returns array of frames. My stupid mistake. But where can I find proper documentation for JS-bindings? Only TestJavascript?
Thanks once again :slight_smile:

I’m looking forward cocos2d-x js documentation too. For now I can only guess the api with c++ documentation.
It pains every time when you encountered a inconsistency. Most APIs are just the name without cc prefix, but some APIs changed e.g. ccTouchBegin->onTouchBegin

Tobias S wrote:

Ok, thanks very much for your advice!
I found great example in file Explosion.js in CocosDragonJS project. Everything works perfect!
It was my fault because I thought that addSpriteFrames returns array of frames. My stupid mistake. But where can I find proper documentation for JS-bindings? Only TestJavascript?
Thanks once again :slight_smile: