I managed to do it.
Here’s a step by step explanation, who knows who may be having the same problems: 
I added some functions that apply the force. They’ll be called by a Runtime EnterFrame, so they can be added each frame. There’s one function for each direction (but I know I can may a variable there and use only one).
Then, created the buttons and added the listeners for their touch.
An finally, the Touch function that tests:
- What mode is on. “began” will add the listener for the enterFrame, and “ended” will remove it.
- Which button was pressed. This will add/remove the corresponding enterFrame function to make the object move.
Here’s the code:
[lua]-- ENTERFRAME LISTENERS
local kickerMoveLeft = function( event )
kicker:applyForce( kickerSpeed * -1, 0, 0, 0 )
end
local kickerMoveRight = function( event )
kicker:applyForce( kickerSpeed, 0, 0, 0 )
end
– DEFINE UI ENTITIES
local function onTouch( event )
local mode = event.phase
local clickedButton = event.target
print(clickedButton.id)
if “began” == mode then
if clickedButton.id == “left” then
Runtime:addEventListener( “enterFrame”, kickerMoveLeft )
elseif clickedButton.id == “right” then
Runtime:addEventListener( “enterFrame”, kickerMoveRight )
end
elseif “ended” == mode or “cancelled” == mode then
if clickedButton.id == “left” then
Runtime:removeEventListener( “enterFrame”, kickerMoveLeft )
elseif clickedButton.id == “right” then
Runtime:removeEventListener( “enterFrame”, kickerMoveRight )
end
end
return true
end
local bt_moveLeft = ui.newButton{ default=“buttonMove.png”, x=100, y=510 }
local bt_moveRight = ui.newButton{ default=“buttonMove.png”, x=270, y=510 }
local bt_shoot = ui.newButton{ default=“buttonShoot.png”, x=860, y=510 }
bt_moveLeft.id = “left”
bt_moveRight.id = “right”
bt_shoot.id = “shoot”
bt_moveLeft:addEventListener( “touch”, onTouch )
bt_moveRight:addEventListener( “touch”, onTouch )
bt_shoot:addEventListener( “touch”, onTouch )[/lua]
It works fine in the simulator!
Right now I can’t test it in the device, so I don’t know if the multitouch will work.
Maybe because of the “elseifs”, the game will only receive one input.
If someone reads this, please tell me what you think. It worked, but if there’s a better solution, I want to try it!!
[import]uid: 11130 topic_id: 3582 reply_id: 10854[/import]