title: how to move the object in specific locations in cocos2d
body: <p>how to move the object in specific locations.</p>
  
  <p>for examples. am having one small bar(width=50, height=10). i have to move this like plunger manually. i want to move only in x cordinates ( limits is x=20(start point) to x=50(end point)) no moves on y coordinates.  but its moving 50 to 10 after wards no movement.<img src="https://i.stack.imgur.com/Lyx2V.png" alt="alt text">
  coding:-</p>
  
  <pre><code>- (void)ccTouchesBegan:(NSSet *)touches withEvent:(UIEvent *)event  {
      if (isPlaying) {
          UITouch *touch = [[event allTouches] anyObject];
  
          touchPosition = [touch locationInView:touch.view];
          if ( CGRectContainsPoint(para3.boundingBox,touchPoint)
                  isDragging = YES;
  
          touchOffset = para3.position.y - touchPosition.y;
  
      }
  - (void)ccTouchesMoved:(NSSet *)touches withEvent:(UIEvent *)event  {
  if (isPlaying) {
  UITouch *touch3 = [[event allTouches] anyObject];
          float distanceMoved = 
          ([touch3 locationInView:touch3.view].y + touchOffset) - 
          para3.position.y;
          float newY = para3.position.y + distanceMoved;
          if (newY &gt; 67 &amp;&amp; newY &lt; 99)
              para3.position = CGPointMake(newY ,  para3.position.y  );
          //para3.contentSize/2
          if (newY &gt;67 )
              para3.position = CGPointMake( 67, para3.position.y );
          if (newY &lt; 99)
              para3.position = CGPointMake( 99, para3.position.y );
      }
  }
  </code></pre>