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

Custom ro*** Objects

Can you create custom ro*** objects? I'd like to create roMyObject with its own properties and methods. Makes me miss OOP.
0 Kudos
3 REPLIES 3
RokuChris
Roku Employee
Roku Employee

Re: Custom ro*** Objects

Yes and no. You can't build your own native components, but you can build your own reusable classes/components in BrightScript.
0 Kudos
breger
Visitor

Re: Custom ro*** Objects

"RokuChris" wrote:
Yes and no. You can't build your own native components, but you can build your own reusable classes/components in BrightScript.

Is there documentation on this?
0 Kudos
malloys
Visitor

Re: Custom ro*** Objects

I believe RokuChris is referring to using roAssociativeArray http://sdkdocs.roku.com/display/sdkdoc/roAssociativeArray for this purpose - member variables can be object instances, including function references - either defined as an inline anonomous function or a named reference to an function/sub defined elsewhere. Member function references can be invoked. The SDK sample code contains many examples of this.
0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.