Reset score after exit or suspend

I want that the score reset to 0 if the app exit or suspend. Is this the right way?

[code]local onSystem = function( event )
if event.type == “applicationExit” then
scores:store( “ball”, 0 )
scores:save()
elseif event.type == “applicationSuspend” then
scores:store( “ball”, 0 )
scores:save()
end
end

Runtime:addEventListener( “system”, onSystem )[/code] [import]uid: 203192 topic_id: 34579 reply_id: 334579[/import]

That seems reasonable. [import]uid: 199310 topic_id: 34579 reply_id: 137526[/import]

That seems reasonable. [import]uid: 199310 topic_id: 34579 reply_id: 137526[/import]