Adam
Adam

Reputation: 1486

roku/brightscript - how to access screen elements from main function

This seems like a basic use case, but I can't find any examples of it anywhere!

I've made a Scene, containing a Label, with id=myLabel. I want to access this label in my main.brs file, so that I can update the text as messages come in. I've tried every way I can think of, but can't get it to work!

This is essentially all I want to do in main.brs:

m.top.myLabel.text="hello"

Upvotes: 1

Views: 365

Answers (1)

U.Mitic
U.Mitic

Reputation: 764

From Your main.brs try:

Scene.findNode("myLabel").text = "some text"

Where Scene is Your scene reference and "myLabel" is an id of your label inside of that scene.

Upvotes: 3

Related Questions