0.0 0


Hi this is my first post here.
I’m trying out using Cocos2DX for the first time, coding in javascript Cocos2d version 2.1.5, testing in the browser and then running in Xcode mobile simulator with cocos2d version 2.1.4.
All is going well, but now I want to use an ActionTween on a custom class I’ve created that extends sprite, called InteractiveSprite. To do this the InteractiveSprite must implement the ActionTweenDelegate interface.
I’m not sure how interface implementation works in javascript (if at all!).

First off I can see that the tween works if I just manually type in the updateTweenAction method and relevant method body as part of my custom sprite class:

updateTweenAction:function(value, key){
        this[key] = value;

Secondly I can see that there is a method ‘implement’ defined on the cc.Class definition. So I try calling that like this:


This works when run in the browser, and I can use debugging to confirm that the property InteractiveSprite.implement genuinely is a function.

But when I try to run this in Xcode I get a compile error:

Cocos2d: Assert failed: target must implement CCActionTweenDelegate

So evidently the javascript binding is not translating the call to implement the ActionTweenDelegate interface over into C++.

Can anybody shed any light as to how to resolve this problem? What is the preferred way to have a node that extends sprite implement an interface/delegate?



Hi, @Alex, I have forwarded this issue to my co-worker WenHai, he is processing the missing API of JSB.

He will reply you soon.


Ok that’s great, thanks Shun Lin!


I’m getting same issue, any update on this ?



It haven’t been fixed yet, but I will check if it is possible to be fixed in Cocos2d-JS v3.0rc


@pandamicro did this bug fixed??


It’s still bugged. Could you please take a look at it ? I’m using javascript. Everything working well on web but when I build it in xcode for iOS i get a assertion fail for tweendelegate.
I tried to add target with method “startWithTarget” but it didn’t helped. Help please.


As far as i see this problem is not resolved yet.
And this is very strange, because about 4 years have passed.