[runAction] How to "runAction on multiple objects

[runAction] How to "runAction on multiple objects
0.0 0


I’m using cocos2dx 2.2 version.

CCSprite classes seems working fine with running multiple actions at a time but when using runAction from “this” class, I can’t make it to run multiple actions at a time

What I want to do is when an image is clicked, change to other sprite image after 0.5 sec. (e.g. change from red color to green color). During that 0.5 sec, sprite will wait for second tap. If second tap is not provoked, do func1, if second tap is provoked, do func2. (e.g. single tap = change from red color to green…double tap = change from red color to blue) And this double tapping works fine when I do this->runAction(Action).

But with this->runAction(Action), I cannot make two sprites to turn green when I touch the first tap on first object and tap on second object.

I think when second object is clicked, the first action is cancelled by the action provoked by second object when using this->runAction(Action) because doing this with sprite works fine.

I said “sprite” but its actually my custom class containing a sprite. And I have array of my class.

So, first object will be “myObj[0]” and second object will be “myObj[1]”
(I tried using runAction in “myObj” class but didn’t work…same for doimg myObj[a]->runAction(Action))

How do i run multiple actions for custom classes?


the children of a node won’t follow his action, just follow scale.
maybe you can write a function that make the node’s children runAction at a time.


maybe targetedAction?