title: Replacing image in sprite - cocos2d game development of iPhone
body: <p>I want to change the sprite image.</p>
  
  <p>Say for example:</p>
  
  <pre><code>mainSprite=[Sprite spriteWithFile:@"redFile.png"];
  [self addChild:mainSprite];
  </code></pre>
  
  <p>Here, Sprite is already added to a layer. I have mainSprite (pointer) which can access it.</p>
  
  <p>If I change </p>
  
  <pre><code>[mainSprite setOpacity:150];
  </code></pre>
  
  <p>it works perfectly. But here I want to change the sprite image instead of opacity.</p>
  
  <p>But I don't know how.</p>