转载地址:http://blog.csdn.net/ssihc0/article/details/6784819
CCSpriteFrameCache *cache = [CCSpriteFrameCache sharedSpriteFrameCache];
[cache addSpriteFramesWithFile:@"t1.plist" textureFile:@"t1.png"];
CCSprite *mySprite = [CCSprite spriteWithSpriteFrameName:@"a1.png"];
mySprite.position = ccp(240,160);
[self addChild:mySprite];
NSMutableArray *climbFrames = [NSMutableArray array];
for(int i = 1; i < 7; i++) {
NSString *fn = [NSString stringWithFormat:@"a%d.png",i];
CCSpriteFrame *frame = [[CCSpriteFrameCache sharedSpriteFrameCache] spriteFrameByName:fn];
[climbFrames addObject:frame];
}
CCAnimation *animateClimb = [CCAnimation animationWithFrames:climbFrames delay:0.2f];
id a1 = [CCAnimate actionWithAnimation:animateClimb restoreOriginalFrame:NO];
[mySprite runAction:a1];