Hi,
While creating the function i always use the print command to check my function is working correctly or not. Today i was creating some listeners to goto next scene and return back to the previous scene using Composer UI.
–this code will be in the firstpage.lua–
local skip = display.newImage (“skipbutton.png”)
function toskip (event)
if event.phase == “began” then
Print (skipped)
composer.gotoScene (“secondpage”)
end
end
skip:addEventListener (“touch” , toskip)
–this code will be in the secondpage.lua–
local back = display.newImage (“backbutton.png”)
function toback (event)
if event.phase == “began” then
Print (back)
composer.gotoScene (“firstpage”)
end
end
back:addEventListener (“touch” , toback)
While using the skip and back button to navigate to both the pages check out the terminal, it is showing lots of skipped and back printed on terminal.
Can any one please tell me why this happenning?
Looking forward for a reply.