This is my test code
main.brs
'********** Copyright 2016 Roku Corp. All Rights Reserved. **********
sub RunUserInterface()
screen = CreateObject("roSGScreen")
m.port = CreateObject("roMessagePort")
screen.setMessagePort(m.port)
scene = screen.CreateScene("MenuList")
screen.show()
while(true)
msg = wait(0, m.port)
msgType = type(msg)
if msgType = "roSGNodeEvent"
if msg.isScreenClosed() then return
end if
end while
end sub
MenuScene.xml
<?xml version = "1.0" encoding = "utf-8" ?>
<component name = "MenuList" extends = "Scene" initialFocus = "Buttons" >
<script type = "text/brightscript" >
<![CDATA[
sub init()
m.top.backgroundURI = "pkg:/images/rsgde_bg_hd.jpg"
m.top.setFocus(true)
end sub
' on Button press selected
Sub onItemSelected()
print "Boton "; m.top.itemSelected
if m.top.itemSelected = 0
m.scene.findNode("epgGridScene")
else if m.top.itemSelected = 1
end if
End Sub
]]>
</script>
<interface>
<!-- Button press handler -->
<field id="itemSelected" type="integer" alwaysnotify="true" alias="Buttons.itemSelected" onChange="onItemSelected" />
</interface>
<children >
<LabelList
id="Buttons"
focusRow = "0"
itemSize = "[440,48]"
translation="[150,150]"
color="0xFFFFFFFF"
focusedColor="0x333333FF"
numRows="5"
sectionDividerHeight = "48.0"
sectionDividerFont = "font:MediumBoldSystemFont"
sectionDividerTextColor = "0x880088FF">
<ContentNode role = "content" >
<ContentNode title = "Livetv" HDLISTITEMICONSELECTEDURL="pkg:/images/icon-logo-design-small.png" HDLISTITEMICONURL = "pkg:/images/icon-logo-design-small.png"/>
<ContentNode title = "Movies" HDLISTITEMICONSELECTEDURL="pkg:/images/icon-logo-design-small.png" HDLISTITEMICONURL = "pkg:/images/icon-logo-design-small.png"/>
<ContentNode title = "Series" HDLISTITEMICONSELECTEDURL="pkg:/images/icon-logo-design-small.png" HDLISTITEMICONURL = "pkg:/images/icon-logo-design-small.png"/>
<ContentNode title = "Events" HDLISTITEMICONSELECTEDURL="pkg:/images/icon-logo-design-small.png" HDLISTITEMICONURL = "pkg:/images/icon-logo-design-small.png" />
<ContentNode title = "Adutls" HDLISTITEMICONSELECTEDURL="pkg:/images/icon-logo-design-small.png" HDLISTITEMICONURL = "pkg:/images/icon-logo-design-small.png" />
<ContentNode title = "Sports" HDLISTITEMICONSELECTEDURL="pkg:/images/icon-logo-design-small.png" HDLISTITEMICONURL = "pkg:/images/icon-logo-design-small.png" />
<ContentNode title = "Setings" HDLISTITEMICONSELECTEDURL="pkg:/images/icon-logo-design-small.png" HDLISTITEMICONURL = "pkg:/images/icon-logo-design-small.png" />
</ContentNode>
</LabelList>
</children>
</component>
epgGridScene.xml
<?xml version="1.0" encoding="utf-8" ?>
<!--********** Copyright 2015 Roku Corp. All Rights Reserved. **********-->
<component name="epgGridScene" extends="Scene">
<children>
<Video
id="Video"
translation = "[1100, 70]"
width = "760"
height= "340"/>
<!-- EPG Grid -->
<customEPGGrid />
</children>
</component>
But I'm throwing this error
BrightScript Micro Debugger.
Enter any BrightScript statement, debug commands, or HELP.
Suspending threads...
Thread selected: 1* pkg:/components/MenuScene.xml(30) m.scene.findNode("epgGridScene")
Current Function:
025: Sub onItemSelected()
026: ' first button is Play
027: print "Boton "; m.top.itemSelected
028: if m.top.itemSelected = 0
029: 'print "Second 1 "
030:* m.scene.findNode("epgGridScene")
031: else if m.top.itemSelected = 1
032: 'print "Second 2 "
033: end if
034: End Sub
Interface not a member of BrightScript Component (runtime error &hf3) in pkg:/components/MenuScene.xml(30)
030: m.scene.findNode("epgGridScene")
Backtrace:
#0 Function onitemselected() As Void
file/line: pkg:/components/MenuScene.xml(30)
Local Variables:
global Interface:ifGlobal
m roAssociativeArray refcnt=2 count:2
Threads:
ID Location Source Code
0 pkg:/source/main.brs(12) msg = wait(0, m.port)
1* pkg:/components/MenuScene.xml(30) m.scene.findNode("epgGridScene")
*selected