text item won't clear the screen

I’m having trouble figuring out how to clear a screen… I’m trying to use Corona for a mainstream app, not for a game.

So I’m combining the business app template with the multi line text tutorial here (https://coronalabs.com/blog/2014/02/11/tutorial-methods-for-positioning-text/) , but I can’t seem to get the screen to clear the multi line text, when I view the other screens in the app. 

Here’s my code for the screen that has multiline text. it’s one of only 4 screens in the app so far, and the only creating a problem - 

local composer = require( "composer" ) local scene = composer.newScene() local widget = require( "widget" ) local widgetExtras = require("widget-extras") local myApp = require( "myapp" ) widget.setTheme(myApp.theme) local titleText local locationtxt local views = {} local function ignoreTouch( event ) return true end -- -- function scene:create( event ) local sceneGroup = self.view local background = display.newRect(0,0,display.contentWidth, display.contentHeight) background:setFillColor( 1.95, 1.95, 1.95 ) background.x = display.contentCenterX background.y = display.contentCenterY sceneGroup:insert(background) background:addEventListener("touch", ignoreTouch) local navBar = widget.newNavigationBar({ title = "Event info", backgroundColor = { 0.96, 0.62, 0.14 }, titleColor = {1, 1, 1}, font = myApp.fontBold }) sceneGroup:insert(navBar) local myText = [[LA at Griffith Park, Los Angeles. la.org @laorg]] local options = { text = myText, x = display.contentCenterX, y = display.contentCenterY, width = 200, height = 300, fontSize = 24, align = "left" } local textField = display.newText( options ) textField:setFillColor( 0, 0, 0 ) --[[local button6 = widget.newButton( { width = 160, height = 40, label = "December", labelColor = { default = { 0.90, 0.60, 0.34 }, over = { 0.79, 0.48, 0.30 } }, labelYOffset = -9, font = myApp.font, fontSize = 18, emboss = false, onRelease = myApp.showScreen2 } ) sceneGroup:insert(button5) button5.x = display.contentCenterX button5.y = display.contentCenterY + 110]]-- end -- -- function scene:show( event ) local sceneGroup = self.view end function scene:hide( event ) local sceneGroup = self.view -- -- Clean up native objects -- end function scene:destroy( event ) local sceneGroup = self.view end scene:addEventListener( "create", scene ) scene:addEventListener( "show", scene ) scene:addEventListener( "hide", scene ) scene:addEventListener( "destroy", scene ) return scene

I’ve looked at a few posts and the documentation, and  I can’t seem to get this figured out. I’ve tried to either understand or attempt the fixes in these URLs:

https://www.youtube.com/watch?v=NHefJ1mexrQ

https://docs.coronalabs.com/guide/programming/05/#hiding-the-scene

https://stackoverflow.com/questions/14713926/changing-scenes-in-corona-objects-stay-on-screen


I made these attempts to clear the text from the screen, they don’t seem to work -

-- Completely remove the scene, including its scene object -- composer.removeScene( "sceneGroup" ) -- -- -- sceneGroup:remove( myText ) --DOESNT WORK, creates ERROR | WARNING: winterevents.lua:134: objectGroup:remove(): index of 0 out of range (should be 1 to 2) -- newText:removeSelf() -- newText = nil -- -- -- composer.removeScene( "sceneGroup" ) 

Your help is definitely appreciated.

It doesn’t appear that you’re adding your text object(s) to the Composer scene’s view group. Do a 

sceneGroup:insert( textField )

Rob

Awesome! thank you. That WORKS

It doesn’t appear that you’re adding your text object(s) to the Composer scene’s view group. Do a 

sceneGroup:insert( textField )

Rob

Awesome! thank you. That WORKS