Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
oa24153
Binge Watcher

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 1
atc98092
Community Streaming Expert

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. 😄

Dan

Roku Community Streaming Expert

Help others find this answer and click "Accept as Solution."
If you appreciate my answer, maybe give me a Kudo.

I am not a Roku employee, just another user.
0 Kudos