title: Adding and accessing CCSprites
body: <p>I'm having trouble inserting multiple children of same sprite and accessing it (or setting positions for them on runtime). Kindly advise any suitable method preferably point out my mistake. Here is my approach. </p>
  
  <pre><code>//In the Init Method...
  
  //int i is defined in the start.
  
      for (i = 1; i &lt; 4; i++)
  
      {
  
          hurdle = [CCSprite spriteWithFile:@"hurdle1.png"];
  
          [self addChild:hurdle z:i tag:i];
  
          hurdle.position = CGPointMake(150 * i, 0);
  
      }
  </code></pre>
  
  <p>It spreads all the sprites on the canvas. then in some "UPDATE Function" I'm calling this.</p>
  
  <pre><code>hurdle.position = CGPointMake(hurdle.position.x - 5, 10);
  
  if (hurdle.position.x &lt;= -5) {
      hurdle.position = ccp(480, 10);
  }
  </code></pre>
  
  <p>It works but as expected only one instance moves horizontally. I want all the instances to be moved so I am trying to use this....</p>
  
  <pre><code>for (i = 1; i &lt; 4; i++){
  
     [hurdle getChildByTag:i].position = CGPointMake(hurdle.position.x - 5, 10);
  
  //OR
     [hurdle getChildByTag:i].position = CGPointMake([hurdle getChildByTag:i].position.x - 5, 10);
  
  }
  </code></pre>
  
  <p>I've tried getting LOGs on various places and realized that getChildByTag doesn't work the way I'm trying to use it.</p>