change Scene on collision with object

Hey guys how do I change a scene on collision using the composer api?

----------------------------------------------------------------------------------------- -- -- level1.lua -- ----------------------------------------------------------------------------------------- local composer = require( "composer" ) local scene = composer.newScene() -- include Corona's "physics" library local physics = require "physics" physics.start() -------------------------------------------- -- forward declarations and other locals local screenW, screenH, halfW = display.contentWidth, display.contentHeight, display.contentWidth\*0.5 function scene:create( event ) -- Called when the scene's view does not exist. -- -- INSERT code here to initialize the scene -- e.g. add display objects to 'sceneGroup', add touch listeners, etc. local sceneGroup = self.view local r = 0 local bkg = display.newImage("spacebkg.png",0,0) bkg:scale(1.5,1.5) local earth = display.newImage("Earth.png",415,80) earth:scale(0.15,0.15) moon = display.newImage("moon.png",55,250) moon:scale(0.15,0.15) total\_rockets = 3 local explosion\_sound = audio.loadSound("explosioncut.wav") local function onCollision( event ) if (event.phase == 'began') then print("it collided") end end local function trackRocket( obj ) obj:removeSelf(); composer.gotoScene( "lose", "fade" ) end local function spawnRocket() local rocket = display.newImageRect("rocket.png",25,25) rocket.x = math.random(0,350) rocket.y = math.random(0,400) transition.to(rocket,{time = math.random(2000,4000),alpha = 1 , x = earth.x,y = earth.y}) function rocket:touch( e ) if (e.phase == "ended") then -- play explosion sound audio.play(explosion\_sound) --remove rocket trackRocket(self); end return true end physics.addBody(rocket,"kinetic") rocket:addEventListener("collision",onCollision) rocket.gravityScale = 0 rocket:addEventListener("touch",rocket) end physics.addBody(earth,"dynamic") earth.gravityScale = 0 tmr = timer.performWithDelay(20,spawnRocket,total\_rockets); end function scene:show( event ) local sceneGroup = self.view local phase = event.phase if phase == "will" then -- Called when the scene is still off screen and is about to move on screen elseif phase == "did" then -- Called when the scene is now on screen -- -- INSERT code here to make the scene come alive -- e.g. start timers, begin animation, play audio, etc. end end function scene:hide( event ) local sceneGroup = self.view local phase = event.phase if event.phase == "will" then -- Called when the scene is on screen and is about to move off screen -- -- INSERT code here to pause the scene -- e.g. stop timers, stop animation, unload sounds, etc.) elseif phase == "did" then -- Called when the scene is now off screen end end function scene:destroy( event ) -- Called prior to the removal of scene's "view" (sceneGroup) -- -- INSERT code here to cleanup the scene -- e.g. remove display objects, remove touch listeners, save state, etc. local sceneGroup = self.view package.loaded[physics] = nil physics = nil end --------------------------------------------------------------------------------- -- Listener setup scene:addEventListener( "create", scene )