title: How do I detect a TouchOut event in Corona SDK?
body: <p>I have a joystick graphic placed in the corner of the screen in my Corona game.</p>
  
  <p>When the user touches the joystick and drags it from side-to-side, it moves the character. However, if the user drags <em>from the middle of the joystick all the way off to the side</em>, then removes his/her finger, the character keeps on moving. I'd like the character to stop on touch-up, even if the touch up is no longer on the joystick graphic.</p>
  
  <p>The joystick image subscribes to the "touch" listener with <code>control:addEventListener( "touch", onTouch )</code>.</p>
  
  <p>Joystick code below:</p>
  
  <pre><code>-- Constants
  local playerSpeed = 300
  local playerDamping = 15
  
  -- Player controls
  local onTouch = function( event )
  
      -- Player rotation
      local deltaX = event.x - control.x
      local deltaY = event.y - control.y
      local magnitude = math.sqrt( deltaX * deltaX + deltaY * deltaY )
  
      player.rotation = math.deg( math.atan2 ( deltaY, deltaX ) )
  
      -- Player speed
      if event.phase == "ended" then
          player.linearDamping = playerDamping
      else
          player.linearDamping = 0
          player:setLinearVelocity( deltaX / magnitude * playerSpeed, deltaY / magnitude * playerSpeed )
      end
  end
  </code></pre>
  
  <p>Any ideas? Thanks!</p>