Hi Guys
i have changed to onPress to onHold.
want to have the buton on pressed to increment & decrement but on hold want to use timerIncrementSpeed to hold down either - + to get to higher/lower numbers quicker… cant seem to get it to work, it works on the on Press adds 1 per touch please help, code below.
local currentNumber = 100
– Handle stepper events
local function onHold( event )
local phase = event.phase
--update currentNumber
if “increment” == phase then
currentNumber = currentNumber+ 1
elseif “decrement” == phase then
currentNumber = currentNumber- 1
end
end
– Create a default stepper (using widget.setTheme)
local newStepper = widget.newStepper
{
left = display.contentWidth-70,
top = 280,
initialValue = 100,
minimumValue = 0,
maximumValue = 200,
timerIncrementSpeed = 1000,
changeSpeedAtIncrement = 5,
--onPress = onPress,
onHold = onHold,
}