Timming, native.newTextField, and composer.... Transition is failing

I am creating a player name input field. Upon event.phase submitted, the code Tries to transition to a new scene.

My transition will fail leaving the next composer scene semi transparent or not present at all depending on the delay between the text field being removed and the scene change being called. Obviously, no delay results in a total fail. The current code works but if the delay gap is only 500 (the timers are 500,1000 respectively ) and not 1000 then the transition will fail. 

Is there an know issue with this setup? 

My test device is the Samsung Google Nexus 4.

Code:

local newSceneOptions = { effect = "crossFade", time = 500, params = { playerInfo = playerInfo } } local function textListener( event ) if ( event.phase == "began" ) then transition.to(popUpWindow, { time = popUpVars.transitionTime, y = popUpVars.popUpWindowPositionXY[2] - popUpVars.positionTransitionOffset, transition = easing.outCubic, }) -- user begins editing text field print( event.text ) elseif ( event.phase == "ended" ) then -- text field loses focus transition.to(popUpWindow, { time = popUpVars.transitionTime, y = popUpVars.popUpWindowPositionXY[2], transition = easing.outCubic, }) elseif ( event.phase == "submitted" ) then playerInfo.name = textInputField.text --callServer.savePlayerInfo( playerInfo ) native.setKeyboardFocus( nil ) transition.to(popUpWindow, { time = popUpVars.transitionTime, y = popUpVars.popUpWindowPositionXY[2], transition = easing.outCubic, }) local function textRemove() textInputField:removeSelf() textInputField = nil end timer.performWithDelay( 500, textRemove ) timer.performWithDelay( 1500, function() return composer.gotoScene( "code.mainMenu", newSceneOptions ) end ) end end

Are you getting any errors in your console log? 

Could your other timer’s be firing before you transitions finish?

Are your transitions objects in your scene’s view group?

I’m not sure why you are returning true in your timer’s anonymous function.  Why don’t you just do this:

timer.performWithDelay( 1500, function() composer.gotoScene( "code.mainMenu", newSceneOptions ) end )

 

Are you getting any errors in your console log? 

Could your other timer’s be firing before you transitions finish?

Are your transitions objects in your scene’s view group?

I’m not sure why you are returning true in your timer’s anonymous function.  Why don’t you just do this:

timer.performWithDelay( 1500, function() composer.gotoScene( "code.mainMenu", newSceneOptions ) end )