Hi! I’m having a problem with transition.pause()
local square = display.newRect( 0, 0, 100, 100 ) local w,h = display.stageWidth, display.stageHeight local function onPause() transition.pause(transition1) end local transition1 = transition.to( square, { time=10000, alpha=0, x=(w-50), y=(h-50)} ) Runtime:addEventListener('tap', onPause)
When I run this and tap on the screen, this error message pops up:
“Attempt to call field ‘pause’ (a nil value)”
I can’t see where the problem is. The code is pretty simple. Can someone please help me understand? I have read http://docs.coronalabs.com/api/library/transition/pause.html but can’t seem to find the answer. Thank you!