Background: I’m making a children’s BookApp and need the
audio/text sync to stop when the user turns the page. So far I tried using a Boolean variable is
changed to true when touch event occurs, then test if it is true during each
loop in textSync function, but it doesn’t work.
I have no idea what to even search for to look for similar
examples. Thank you for helping.
Sample of what I have tried:
local touchDetected = 0 local function testPrint( ) for i=1, 300000 do print( i ) if touchDetected == 1 then break end end end local function onScreenTouch( event ) print("touch") touchDetected = 1 end -- begin listening for screen touches Runtime:addEventListener( "touch", onScreenTouch ) testPrint()