Hello folks,
I’ve got a small problem. Let me describe what I want to do. I am doing a picture book using storyboard API. I have a couple of arrows to navigate between pages. I don’t want to have a home button. Therefore I came up with an idea - if a user singel taps an arrow, next page is shown. But double tap would show the first page.
The issue is that there is no event “doubletap” only “tap”. There is of cause numTaps. But if a user double taps an object the tap even is called 2 times: first where numTaps = 1 and second with numTaps = 2.
I thought I could manage this as follows (please note this is not a complete code)
local numTaps
local timerStash = {}
local function goToScene()
if numTaps \> 1 then
timer.cancel(timerStash[1])
storyboard.gotoScene(true, "firstPage", effect, 500)
else
storyboard.gotoScene(true, nextPage, effect, 500)
end
end
local function turnPage(event)
numTaps = event.numTaps
table.insert(timerStash, timer.performWithDelay(350, goToScene, 1))
end
But this thing just crashes.
Please help. Thanks in advance. [import]uid: 40334 topic_id: 20908 reply_id: 320908[/import]
