I want to add new screen from MainScene to get components from category_screen.
sub init()
? "[MainScene] Init"
' m.top.SetFocus(true)
m.category_screen = m.top.findNode("category_screen")
m.category_screen.setFocus(true)
end sub
This is my MainScene.xml
<?xml version="1.0" encoding="UTF-8"?>
<!--********** Copyright 2016 Roku Corp. All Rights Reserved. ********** -->
<component name="MainScene" extends="Scene" initialFocus="category_screen">
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://devtools.web.roku.com/schema/RokuSceneGraph.xsd">
<!-- importing main handler -->
<interface>
<function name="callingJSON" />
<function name="DataLoaded" />
</interface>
<script type="text/brightscript" uri="pkg:/components/MainScene.brs" />
<children>
<category_screen
id="category_screen"
visible="true"
translation="[0,0]" />
<Group id="Description" translation="[108, 90]">
<Label id="titleText" color="0xFFFFFF" wrap="true" width="1240"
lineSpacing="0.0" text="" translation="[0, 150]">
<!-- <Font role="font" uri="pkg:/fonts/fonts_bold.otf" size="26" /> -->
</Label>
<Poster id="image" translation="[0, 190]" uri="" width="308"
height="308" />
<!-- uri="pkg:/images/menu_close_logo.png" -->
</Group>
<!-- <Timer id="testTimer" repeat="true" duration="5" /> -->
</children>
</component>
This is my category_screen.brs
function init()
?"innnt"
m.category_list=m.top.findNode("category_list")
m.category_list.setFocus(true)
m.category_list.observeField("itemSelected", "onCategorySelected")
end function
This is my category_screen.xml
<?xml version="1.0" encoding="utf-8" ?>
<component name="category_screen"
extends="Group"
>
<script type="text/brightscript" uri="pkg:/components/screens/category_screen.brs" />
<children>
<Label
translation="[75, 150]"
id="env"
font="font:LargeBoldSystemFont"
text="PICK A CATEGORY:"/>
<RadioButtonList
id="category_list"
translation="[100, 200]"
itemSize="[400,48]"
>
<ContentNode id = "categories" role = "content" >
<category_node title = "DRAMA" feed_url="http://10.0.1.69:8888/roku_lessons/drama.json"/>
<category_node title = "COMEDY" feed_url="http://10.0.1.69:8888/roku_lessons/comedy.json"/>
<category_node title = "HORROR" feed_url="http://10.0.1.69:8888/roku_lessons/horror.json"/>
</ContentNode>
</RadioButtonList>
</children>
</component>
I want to make new screen and access content node from MainScene