simple cocos2d animation using .png sequence

Right, so I do a lot of animation in my apps, so here is the most simple creation of it

yourfile.h

@private CCSprite *youranimref;
@private CCAnimation *animation;

yourfile.m

-(id) init
{
if( (self=[super init] )) {

self.isTouchEnabled = YES;

size = [[CCDirector sharedDirector] winSize];

// DECLARE ANIMATION
animation = [[CCAnimation alloc] initWithName:@"youranimref" delay:1/24.0];
youranimref = [CCSprite spriteWithFile:@"yourFirstAnimGrfx.png"];
[animation addFrameWithFilename: @"yourSecondAnimGrfx.png"];
[animation addFrameWithFilename: @"yourThirdAnimGrfx.png"];
[animation addFrameWithFilename: @"yourFourthAnimGrfx.png"];

// ADD ANIMATION
youranimref.position = ccp( 512, 435 );
[self addChild:youranimref z:5];

}
return self;
}

- (void) dealloc
{

// !!!!! VERY IMPORTANT - REMOVE TEXTURES AND RELEASE REFERENCE TO THE ANIMATION

[[CCTextureCache sharedTextureCache] removeUnusedTextures];
[[CCSpriteFrameCache sharedSpriteFrameCache] removeUnusedSpriteFrames];

// RELEASE RETAINED OBJECTS
[animation release];

[super dealloc];
}

- (void) runAnimation
{

// RUN THE ANIMATION

CCAnimate* action = [CCAnimate actionWithAnimation:animation];
[youranimref runAction:action];

}

moar animation

look! perspective n whatnot!

walk+hat tip

Its been an interesting ride thus far. Really struggled with the first completed animation, had to go away and think about it for a bit, do some research (finally had a reason to read richard willams 2d animation book). Realized I was jumping the gun and making lovely finished single frames before finishing the animation, which was never gonna fly. Bit of a refresher on walk cycles, drawing in ‘wireframe’ essentially, all coming together much faster now.