If I understand you correctly, you want to have the object continue rotating when the button is still pressed, correct? If so, you were right, you have to add an event listener…or you can you can use Peach’s way. By the way Peach, It would help me a lot if you could take a look at my problem Here
[lua]_W = display.contentWidth;
_H = display.contentHeight;
local function Button( event )
local phase = event.phase
if “began” == phase then
function Rotate ()
square.rotation = square.rotation + 5;
end
Runtime:addEventListener(“enterFrame”, Rotate)
elseif “ended” == phase or “cancelled” == phase then
Runtime:removeEventListener(“enterFrame”, Rotate);
end
end
square = display.newRect(0, 0, 100, 100);
square.x = _W * 0.5;
square.y = _H * 0.5;
square:setFillColor(255,255,255);
local button = display.newRect( 0, 0, _W, _H)
button.x = _W * 0.5;
button.y = _H * 0.5;
button:setFillColor(0, 0, 0, 0)
button:addEventListener( “touch”, Button )
[import]uid: 17138 topic_id: 12298 reply_id: 44838[/import]