Particle System issue - beginner question

Hi, all

I am new here and still learning the cocos2d-x framework step by step.

Currently I am doing a practise which I want to be able to do this.

I have a sprite and it can jump. when the sprite hit something like a speed ball, the sprite will jump 2x higher, so the sprite has 2 functions, jump() and superjump().

What I am doing here is when the sprite is created, I also create a particle effect and add it as a child of the sprite. then hide it immediately using myParticle->setVisible(false). when the sprite hits the speed ball, it calls the superjump() function which find the particle and set the visible to true ( myParticle->setVisible(true) ) , the problem is when it is calling “myParticle->setVisible(true) ’ , it gets an error says”draw should not be called when added to a particleBatchNode"

Just wonder if I am doing this in a right way. again the logic here is create the particle effect and hide it, when need to show it, set the visible to true. but it just gets me an error.

Please help guys.

If you create a CCNode called myNode, you can say myNode.addChild(myParticle) and then say myNode->setVisible(false)

Excuse the misinformation, the system just restarts when you do this, but I would like to achieve the same effect. I will look into it.