Corona crashing when I try to Drag an object using dragBody

Hi, Im a new Corona user and I first want to say that so far it’s an excellent tool. However, I currently can’t figure out why Corona is crashing when Im trying to drag an object using the dragbody function in the DebugDraw example. Corona crashes before a debug message can appear so I can’t pinpoint exactly where the problem is. Here is the code Im using now.

local physics = require(“physics”)
local gameUI = require(“gameUI”)
physics.start()
local dragBody = gameUI.dragBody
sprtTurtle = display.newImage(“sprtTurtle.png”)
sprtTurtle.x = 100
sprtTurtle.y = 100
physics.addBody(sprtTurtle, “kinematic”)
sprtTurtle:addEventListener (“touch”, dragBody)

I do have “gameui.lua” in the same directory as “main.lua.” So I know that’s not the problem. From what I see in the DebugDraw example, the above code seems like the absolute minimum to get this going. Thanks in advance for any help. [import]uid: 27520 topic_id: 6037 reply_id: 306037[/import]

If you want to drag something, try something like this:

function moveBall( event )
Ball.x = event.x
Ball.y = event.y
end
Runtime:addEventListener(“touch”, moveBall) [import]uid: 7116 topic_id: 6037 reply_id: 20674[/import]

Thanks for the help. Your function worked when dragging an object a low speeds, however it would not work well if I dragged the object quickly. Anyway, I figured out the problem. It see, that Corona has problems with dragging objects which are set to “kinematic”. If I changed the type to “dynamic” everything started working.

This thread help me find the issue:
http://developer.anscamobile.com/forum/2010/09/04/kinematic-touch-joints-crashes-sim

Let’s hope the Corona devs find a solution. [import]uid: 27520 topic_id: 6037 reply_id: 21175[/import]