Moving character with continous touch

I want to be able to move my main character by 1 pixel if the player is touching the button image. The problem is that I have to keep tapping the button to move the character. Is there a way to detect if the player is continuously touching the button so I can continuously move the character?

Here’s the code that will move the character by 1 pixel across the screen.

[code]
function joystickControls(self, event)
if(event.phase == “began”) then
char.x = char.x + 1
end
end

button = display.newImageRect( “button.png”, 62, 51, true )
button.x = 120; button _Joystick.y = _H-40
button.touch = joystickControls
button ( “touch”, button )
[/code] [import]uid: 14218 topic_id: 13790 reply_id: 313790[/import]

here you go, i think thats exactly what you need) if so, dont forget to say thanks ))
[lua]local touched = false

local char = display.newRect(0,0,50,50)
char.x = 50
char.y = 50
button = display.newImageRect( “coffee1.png”, 62, 51, true )
button.x = 120; button.y = 400

function joystickControls(event)
if event.phase == “began” then
touched = true
print(touched)
elseif event.phase == “ended” then
touched = false
print(touched)
end
end

function movechar()
if touched == true then
char.x = char.x + 1
elseif touched == false then
return false
end
end
button:addEventListener( “touch”, joystickControls )
Runtime:addEventListener(“enterFrame”, movechar)[/lua] [import]uid: 16142 topic_id: 13790 reply_id: 50636[/import]

Thank you darkconsoles!!! This is exactly what I needed! I love the Corona Community, thank you again! [import]uid: 14218 topic_id: 13790 reply_id: 50662[/import]