Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
oa24153
Level 8

Error parsing XML component MainScene.xml

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

 

0 Kudos
1 Reply
atc98092
Level 21

Re: Error parsing XML component MainScene.xml

You need to post this in the Developers portion of the Community. Mostly here you only find end users who have no idea what any of that code means. Smiley Very Happy

Dan
Roku Stick (3600), Ultra (4640), Ultra (4670), Ultra (4800), Premiere (3920), Insignia 720p Roku TV, Sharp 4K Roku TV, Nvidia Shield, Windows 10 Pro x64 running Serviio and Plex on a wired Gigabit network.
0 Kudos