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: 
neowinston
Visitor

How do I pass a string to sub init() of XML file?

I need to pass a string to sub init() or any other function or field of a LabelList XML file. How do I do that? Thanks for your help!
0 Kudos
2 REPLIES 2
destruk
Binge Watcher

Re: How do I pass a string to sub init() of XML file?

Init is executed when the component is compiled, so I wouldn't think you would be able to 'pass' a value into it in Init from outside the component.  To set a variable within the init function you would just do that -- m.temp="Hello"

You would be able to pass values into compiled components by making the value global so the component can pull from the global namespace, or by setting up a field in the xml to transfer values in and out of the component.

<interface>
<field id="mydata" type="string" />
</interface>
0 Kudos
neowinston
Visitor

Re: How do I pass a string to sub init() of XML file?

Thank you!
0 Kudos