Why won't this simple GROUP exercise work?!?!?!?!?!?!?!?!?!

So the problem is that when I transition from scene to scene everything works fine except this text box will not remove itself, WHY?! Everything else in the app does… it’s the simplest code too… just an exercise… PLEASE HELPPPPPPPPPPPP my head hurts from banging the wall.

– Alpha

– Version: 1.0

– 

– Copyright © 2013 Soundstache,Inc

– Bela` Hackman, Nick Redmond


local storyboard = require “storyboard”

local widget = require( “widget” )

local scene = storyboard.newScene()

function scene:createScene( event )

    local group  = self.view

    ------------------------------------

    display.setDefault( “background”, 187, 216, 125 )

    local widgetGroup = display.newGroup()

    local bestBox = native.newTextBox( 30, 140, 260, 150 )

    bestBox.isEditable = true

    bestBox:setReturnKey(“done”)

widgetGroup:insert( bestBox )

group:insert ( widgetGroup )

    ------------------------------------

end

scene:addEventListener( “createScene”, scene )

return scene

@@@@@@@@@@@--------------OKAY, the Main.lua looks like this…

– Alpha

– Version: 1.0

– 

– Copyright © 2013 Soundstache,Inc

– Bela` Hackman, Nick Redmond


local storyboard = require ( “storyboard” )

local widget = require( “widget” )

display.setStatusBar( display.HiddenStatusBar )


– Create buttons table for the tab bar

local tabButtons = 

{

    {

        width = 32, height = 32,    

        defaultFile = “assets/tabIcon.png”,

        overFile = “assets/tabIcon-down.png”,

        label = “Profile”,

        onPress = function() storyboard.gotoScene( “bandProfile” ); 

            display.remove( splash )

            end,

        selected = true

    },

    

    {

        width = 32, height = 32,    

        defaultFile = “assets/tabIcon.png”,

        overFile = “assets/tabIcon-down.png”,

        label = “GPS”,

        onPress = function() storyboard.gotoScene( “screen1” ); 

            audio.play(backgroundMusic);

            display.remove( splash )

            end,

        selected = false

    },

    {

        width = 32, height = 32,

        defaultFile = “assets/tabIcon.png”,

        overFile = “assets/tabIcon-down.png”,

        label = “List”,

        onPress = function() storyboard.gotoScene( “screen2” ); 

            display.remove( splash )

            end,

            

    },

    {

        width = 32, height = 32,

        defaultFile = “assets/tabIcon.png”,

        overFile = “assets/tabIcon-down.png”,

        label = “Maps”,

        onPress = function() storyboard.gotoScene( “screen4” ); 

            display.remove( splash )

            end,

    }

}

–Create a tab-bar and place it at the bottom of the screen

local demoTabs = widget.newTabBar

{

    top = display.contentHeight - 50,

    width = display.contentWidth,

    backgroundFile = “assets/tabbar.png”,

    tabSelectedLeftFile = “assets/tabBar_tabSelectedLeft.png”,

    tabSelectedMiddleFile = “assets/tabBar_tabSelectedMiddle.png”,

    tabSelectedRightFile = “assets/tabBar_tabSelectedRight.png”,

    tabSelectedFrameWidth = 20,

    tabSelectedFrameHeight = 52,

    buttons = tabButtons

}

– Start at home

storyboard.gotoScene( “bandProfile” )

I think you have to remove native objects manually.

Put “local bestBox” at the top of your lua file where you define all your variables/objects, so you can reference it outside of createScene - remember to remove the local bit when creating the text box.

Then in exitScene put:

[lua]

  bestBox:removeSelf()             

  bestBox = nil

[/lua]

     

I think you have to remove native objects manually.

Put “local bestBox” at the top of your lua file where you define all your variables/objects, so you can reference it outside of createScene - remember to remove the local bit when creating the text box.

Then in exitScene put:

[lua]

  bestBox:removeSelf()             

  bestBox = nil

[/lua]