Hi,guys,
How to destroy the widget button when gotoScene is called?
local function handlePlayButtonEvent(event)
if ( "ended" == event.phase ) then -- Debug
composer.gotoScene( "scene.game",{ effect = "slideDown", params = { } })
end
end
local playButton = widget.newButton(
{
label = "Play",
labelColor = { default={ 1, 1, 1 }, over={ 1, 1, 1, 0.55 } },
fontSize = 32,
x = display.contentCenterX,
y = display.contentCenterY + 60,
-- Properties for a rounded rectangle button
emboss = true,
textOnly = true,
onEvent = handlePlayButtonEvent
}
)