Hello,
I have a problem, in my code creates a menu that is collected on the screen, when selected, the menu appears, and if I click on the button “publicar” moves to the scene, everything disappears under the user input box.
In general the input box doesn’t disappears when I tap a button and traslate to another scene.
I’d appreciate your help
Kevin
local function boton_publicar (event)
if event.phase == “ended” then
composer.gotoScene( “scenes.publicar”, {effect=“fade”, time=200, params = {resume=false}} )
end
end
local menu_grafico = display.newImage(“imagenes/menu_grafico.png”, -37,65, true) menu_grafico.xScale = 0.15; menu_grafico.yScale = 0.15; --menu_grafico.y = display.contentHeight/7.5 sceneGroup:insert(menu_grafico) local publicar = display.newText(“Publicar Anuncio”, -45, 120, native.systemFont, 12); --local publicar = display.newText(“Publica un Anuncio”, 260, -15, native.systemFont, 10); sceneGroup:insert(publicar) publicar:addEventListener (“touch”, boton_publicar) local top10 = display.newText(“Top 10”, -45, 50, native.systemFont, 12); sceneGroup:insert(top10) local preferidas = display.newText(“Las Preferidas”, -45, 85, native.systemFont, 12); sceneGroup:insert(preferidas) local buscar = display.newImage(“imagenes/lupa.png”,-45, 15); buscar.xScale = 0.145; buscar.yScale = 0.145; sceneGroup:insert(buscar) local usuario = native.newTextField(-45, 15, 64, 29) usuario.size = 14 usuario.isVisible = false sceneGroup:insert(usuario) usuario:addEventListener( “userInput”, usuario ) --local lblFeedbackk = display.newText( “”, 250, 300, native.systemFont, 28 ) function usuario:userInput(event) --[[if event.phase == “began” then event.target.text = ‘’ lblFeedbackk.text = “waiting”]] if event.phase == “ended” then --lblFeedbackk.text = “Thank you” … " " … event.target.text if event.target.text == “leslie” then composer.gotoScene( “scenes.modelo”, “fade”, 840 ) usuario.isVisible = false end if event.target.text == “Leslie” then composer.gotoScene( “scenes.modelo”, “fade”, 840 ) usuario.isVisible = false end --[[elseif event.phase == “submitted” then lblFeedbackk.text = “Hello” … " " … event.target.text elseif event.phase == “editing” then lblFeedbackk.text = event.startPosition]] end end function buscar:tap( event ) native.setKeyboardFocus( nil ) end buscar:addEventListener(“tap”, buscar) function mover(event) if(event.phase == “began”)then diferenciaY = event.y - menu_grafico.y diferenciaX = event.x - menu_grafico.x --[[elseif(event.phase == “moved”)then --menu.y = event.y - diferenciaY menu_grafico.x = event.x - diferenciaX publicar.x = event.x - diferenciaX - 20 top10.x = event.x - diferenciaX - 20 preferidas.x = event.x - diferenciaX - 20 if (menu_grafico.x >= 75) then menu_grafico.x = 75 publicar.x = 57 top10.x = 57 preferidas.x = 57 elseif (menu_grafico.x <= -30) then menu_grafico.x = -30 publicar.x = -45 top10.x = -45 preferidas.x = -45 end --]] elseif (event.x > 110) then menu_grafico.x = -37 publicar.x = -45 top10.x = -45 preferidas.x = -45 usuario.x = -45 usuario.isVisible = false buscar.x = -45 elseif ((event.x >= 0) and (event.x <= 60)) then menu_grafico.x = 75 publicar.x = 57 top10.x = 57 preferidas.x = 57 usuario.isVisible = true usuario.x = 45 buscar.x = 92 end end menu_grafico:addEventListener(“touch”, mover)