Change Velocity of an object to event

How can i make the velocity of my ship go towards wherever the user touches, similar to transition.to but different at the same time, i tried this however it doesn’t work:

local ship = display.newImage("ship")  
local function changeV(event)  
if (event.phase == "began") or (event.phase == "moved") then  
ship:setLinearVelocity(event.x, event.y)  
end  
end  

please help!! [import]uid: 38977 topic_id: 21101 reply_id: 321101[/import]

You can try something like this it will propel the ship forward in the direction the user pulls back in. Just replace player with ship. Not sure this gives you what you want but it won’t hurt to try.

local function playerTouched( event )
if ( event.phase == “began” ) then
display.getCurrentStage():setFocus(player)
elseif ( event.phase == “ended”) then
player:applyLinearImpulse(event.xStart - event.x, event.yStart - event.y, player.x, player.y)
display.getCurrentStage():setFocus(nil)
end
end
player:addEventListener(“touch”, playerTouched) [import]uid: 80890 topic_id: 21101 reply_id: 83407[/import]

Well i finally found something that kinda got it working, thank you for your help, if you want to see it i have it here, i am using level helper so unless you have level helper too, you can’t really edit it: http://www.filesavr.com/RIMZ9GVFFPNRGSU [import]uid: 38977 topic_id: 21101 reply_id: 83414[/import]