every level/place in your game is a layout for the most part. You may want to have a game over layout. Or if you want to go to another layout use the System > Go To Layout option. That ends the current layout and starts another. If you want to close the browser or tab, then you need to use the browser object and use it's events.