I have two lua file for sliding the image with buttons for going back to menu page but this “menu” button is not working is not working.Now i am bit confused what to do.Facing this problem for a long time
page1.lua
module(..., package.seeall)
function new()
local localGroup = display.newGroup()
local bgimage = display.newImageRect( "Page01.jpg", 1024, 768 )
bgimage.x = 512
bgimage.y = 384
localGroup:insert( bgimage )
local showFx
local function createBook ( event )
director:turnToBook ()
director:newBookPages( pageList )
end
showFx = transition.to ( bgimage, { onComplete = createBook } )
return localGroup
end
and the next is page.lua
module(..., package.seeall)
function new(params)
local localGroup = display.newGroup()
local image = display.newImageRect( params.image, 1024, 768 )
image.x = 512
image.y = 384
localGroup:insert( image )
local menubtn = display.newImage ("menu.png")
menubtn.x = display.viewableContentWidth/1.08
menubtn.y = display.viewableContentHeight/1.11
localGroup:insert(menubtn)
local fmenu = function( event )
if event.phase == "ended" then
print("I am here.")
director:changeScene("menu")
end
end
menubtn:addEventListener("touch",fmenu)
return localGroup
end
the “menubtn” is not working.dont know what to do?Can anybody help me out please?
[import]uid: 82446 topic_id: 16996 reply_id: 316996[/import]