Director does not change scene with removeEventListener

Hello!

I am trying something in “Drag me” corona sample.
When you drag an object and it goes in a specific position, it will no more move.
I am doing this using
box01:removeEventListener( “touch”, onTouch )
when in the specific position.

when the above occurs (the box is in place), the change scene does not work (tapping on home button-image)
local bthome= ui.newButton{
default = “bthome.png”,
over = “bthomek.png”,
onEvent = GoToMainmenu,
id = “StartPage”
}
local function GoToMainmenu ( event )
if event.phase == “release” then
director:changeScene(“mainmenu”)
display.remove( localgroup )
end
end

Any idea what is the fault?

Thank you in advance!

PS. Congratulations Ricardo for being Corona SDK Certified Developer! [import]uid: 38658 topic_id: 9684 reply_id: 309684[/import]

I know this is simple, but have you tried:

[lua]-- define the touch function first
local function GoToMainmenu ( event )
if event.phase == “released” then
director:changeScene(“mainmenu”)
display.remove( localgroup )
end
end

local bthome= ui.newButton{
default = “bthome.png”,
over = “bthomek.png”,
onEvent = GoToMainmenu,
id = “StartPage”
}
[import]uid: 12455 topic_id: 9684 reply_id: 35258[/import]

Thank you for the reply!

but, no, it didnt work… [import]uid: 38658 topic_id: 9684 reply_id: 35262[/import]