Hi, i have a problem with my hero:removeSelf()
for some reason it doesn’t trigger my function Hero:finalize()
. I put my hero:removeSelf()
in scene:hide()
function scene:hide( event )
if ( event.phase == "will" ) then
hero:removeSelf()
--world = nil
elseif ( event.phase == "did" ) then
Runtime:removeEventListener("enterFrame", enterFrame)
end
end
and this is my finalize
function Hero:finalize()
print("hilang kan")
Hero:removeEventListener( "collision" )
Runtime:removeEventListener( "enterFrame", enterFrame )
Runtime:removeEventListener( "key", key )
end