Forum Discussion

mape's avatar
mape
Visitor
9 years ago

Passing data to the component

Hello everybody. 

I'm novice to Roku and BrightScript, so, my question in very simple.

How to pass some data to the component? What is regular way to it?

The constructor, init() method, can't has any parameters. 
This page https://sdkdocs.roku.com/display/sdkdoc/Component+Functions says that component can gave only two built-in methods. Really? Is so, I can't add my own methods. 
I had dig in the documentation and samples, but didn't find the answer. 
  • The component must specify <interface> elements.

    To pass data to a component, set the interface value for that component.

    To read data passed to it, the component uses an observer to listen for changes to its interface field.
  • This is too complex way. 
    I found the 'functional fields'. This is like a regular methods. 
    But supported only in SDK 7.5, it is suitable.