no animation display

@
CCSprite* psptLight = CCSprite::create( “COG_Effect_Profile/Effect_Files_Original/101/image6.png” );
ASSERT_POINTER( psptLight );
psptLight~~>setPosition );
addChild;
CCAnimation* panmLight = CCAnimation::create;
ASSERT_POINTER;
panmLight~~>addSpriteFrameWithFileName( “COG_Effect_Profile/Effect_Files_Original/101/image10.png” );
panmLight~~>addSpriteFrameWithFileName;
panmLight~~>addSpriteFrameWithFileName( “COG_Effect_Profile/Effect_Files_Original/101/image8.png” );
panmLight~~>addSpriteFrameWithFileName;
panmLight~~>addSpriteFrameWithFileName( “COG_Effect_Profile/Effect_Files_Original/101/image11.png” );

CCAnimate* pLightAnimAction = CCAnimate::create( panmLight );
ASSERT_POINTER( pLightAnimAction );

psptLight~~>runAction;
pLightAnimAction~~>setDuration( 0.1f );
@

the sprite appears at the position, but it doesn’t animate, i don’t know why.

Your code is slightly different from mine, but I had a very similar problem.

In my case the problem was in the CCAnimation::create() method call.

Here’s how I did it.

CCArray *FrameArray = CCArray::create();
FrameArray~~>addObject~~>spriteFrameByName);
FrameArray~~>addObject~~>spriteFrameByName);
FrameArray~~>addObject~~>spriteFrameByName);
m_pAnimation = CCAnimation::create));
m_pAnimation~~>setRestoreOriginalFrame;
m_pAnimation~~>setLoops(1);
m_pAnimation~~>retain;
m_pAnimateAction = CCAnimate::create;
m_pAnimateAction~~>setDuration(Animation_Time);
m_pAnimateAction->retain();

I hope this helps.

Scott Hampson wrote:

Your code is slightly different from mine, but I had a very similar problem.
>
In my case the problem was in the CCAnimation::create() method call.
>
Here’s how I did it.
>
CCArray *FrameArray = CCArray::create();
FrameArray~~>addObject~~>spriteFrameByName);
FrameArray~~>addObject~~>spriteFrameByName);
FrameArray~~>addObject~~>spriteFrameByName);
>
m_pAnimation = CCAnimation::create));
m_pAnimation~~>setRestoreOriginalFrame;
m_pAnimation~~>setLoops(1);
m_pAnimation~~>retain;
>
m_pAnimateAction = CCAnimate::create;
m_pAnimateAction~~>setDuration(Animation_Time);
m_pAnimateAction->retain();
>
I hope this helps.

Thank you for you reply. I find the problem that i haven’t set the duration of the animation.