Hi,
I have a PanelSet and when I navigate I add some panels progressively. When I back to the first screen, in the debug console, when I use
sgnodes roots I see old screens not linked to the root (and in memory ?)
function init()
m.panelset = createObject("roSGNode", "PanelSet")
m.panelset.observeField("isGoingBack","onGoBack")
m.panelset.translation = [0,0]
m.top.appendChild(m.panelset)
addScreen("HomeScreen",{})
end function
function addScreen(screenName,screenData)
m.currentScreen = m.panelset.createChild(screenName)
m.currentScreen.leftPosition = 0
m.currentScreen.observeField("mainBackground", "onChangeMainBackground")
m.currentScreen.observeField("nextScreen", "onNextScreen")
m.currentScreen.screenData = screenData
m.currentScreen.setFocus(true)
end function
function onGoBack(e)
print "on go back"
if (e.getData() = true) then
print "removing current screen"
m.currentScreen.unobserveField("mainBackground")
m.currentScreen.unobserveField("nextScreen")
end if
end function
what can I do to completly destroy my panels ?
best regards,
Jeremie.