MainScene file:
<?xml version="1.0" encoding="utf-8"?>
<component name="MainScene" extends="Scene">
<script type="text/brightscript" uri="MainScene.brs" />
<script type="text/brightscript" uri="pkg:/components/UI/ScreenStack.brs" />
<script type="text/brightscript" uri="pkg:/components/UI/HomeScreen.brs" />
<children>
<Spinner />
</children>
</component>
MainScene.brs:
function init()
m.top.backgroundUri = ""
m.top.backgroundColor = "#0E1420"
m.screenStack = []
InitScreenStack()
ShowHomeScreen()
end function
...
I have a HomeScreen component, when user click in "Channels" i want create component and add in ScreenStack
HomeScreen.brs:
...
...
sub updateFocus()
for each key in m.borders
m.borders[key].opacity = 0
end for
m.borders[m.currentFocus].opacity = 1
end sub
function onKeyEvent(key as String, press as Boolean) as Boolean
if press then
nextFocus = invalid
if key = "OK" then
ClickButton(m.currentFocus)
return true
end if
...
...
...
end if
if nextFocus <> invalid then
m.currentFocus = nextFocus
m.buttons[nextFocus].setFocus(true)
updateFocus()
return true
end if
end if
return false
end function
function ClickButton(button as String)
print "ClickButton: "; button
if button = "channels" then
m.CatagoryChannels = CreateObject("roSGNode", "ChannelsCategory")
ShowScreen(m.CatagoryChannels)
end if
end function
ShowScreen(m.CatagoryChannels) don't exist in this scope.
How i can resolve it?
Resolved using observed:
Resolved using observed: