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: 
ssaguiar
Streaming Star

Can I set a boolean global variable?

Hi to all.

I am developing a channel for our firm and am having some question (a lot of them).

One of these questions is if I can create a global boolean variable.

I am able to create string global variables this way:

m.global = m.screen.getGlobalNode()
m.global.id = "GlobalNode"
m.global.addField("TOKEN", "string", true)

then, I write to the variable:

m.global.TOKEN = "09834934539"

and read it, in any scene:
token = m.global.TOKEN

This works fine, but it seems that I can't use something to use global boolean variables as:

m.global.addField("AUTHENTICATED", "boolean", true)

then set it:
m.global.AUTHENTICATED = true

and read it:
isauthenticated = m.global.AUTHENTICATED

Is this the correct way or I am wrong?

Thanks for any clue about it.

 

0 Kudos
1 REPLY 1
xoceunder
Roku Guru

Re: Can I set a boolean global variable?

Yes is corect use

 

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.