title: Touch scroll on Air for Android in Adobe Flash
body: <p>I'm trying to make a touch-based scrolling <code>MovieClip</code> with many buttons.  I want that button to move according to the movieclip's <code>mouseDown</code> or <code>mouseUp</code> events.  I hope someone can help me with this problem.</p>
  
  <pre><code>var maxY:Number = 725;
  var minY:Number = 350;
  var _startY:Number;
  var _startMouseY:Number;
  addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
  
  function mouseDownHandler(event:MouseEvent):void {
      _startY = davies.y;
      _startY = toa.y;
      _startMouseY = mouseY;
      stage.addEventListener(MouseEvent.MOUSE_MOVE, stage_mouseMoveHandler, false, 0, true);
      stage.addEventListener(MouseEvent.MOUSE_UP, stage_mouseUpHandler, false, 0, true);
  }
  
  function stage_mouseMoveHandler(event:MouseEvent):void {
      var offsetY:Number = mouseY - _startMouseY;
      background_scroll_product.y = Math.max(Math.min(maxY, _startY + offsetY), minY);
      davies.y = Math.max(Math.min(maxY, _startY + offsetY), minY);
      toa.y = Math.max(Math.min(maxY, _startY + offsetY), minY);
  }
  
  function stage_mouseUpHandler(event:MouseEvent):void {
      stage.removeEventListener(MouseEvent.MOUSE_MOVE, stage_mouseMoveHandler);
      stage.removeEventListener(MouseEvent.MOUSE_UP, stage_mouseUpHandler);
  }
  </code></pre>
  
  <p>Before and after scroll :</p>
  
  <p><img src="https://i.stack.imgur.com/WKgRn.png" width="200"/><img src="https://i.stack.imgur.com/Rq4KI.png" width="200"/></p>