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

How to create a timer? (without xml)

I'm trying to make a timer for a certain bit of functionality in my Roku app, but I'm having the most annoying difficulty making it happen. I blame my lack of experience. First of all, no matter what I try, I can't make xml files that work with my program so I'm trying to write the timer without xml files. My understanding is that I can create an roSGNode to carry the information needed, subverting the need for an xml file. However, the program does not seem to be able to interpret the CreateObject function that makes the node.

Say, for example, I create a node like this
clock = CreateObject("roSGNode", "Timer")

The program crashes at this function with the console giving me the message "Failed to create roSGNode with type Timer."

Are there any solutions to this problem? Am I doing something wrong? Does the functionality of timers in Roku force me to use xml files? (because, again, i've found it impossible to compile programs with xml components).
I AM THE ARCHMAGE... who is also rather new to Brightscript so forgive me for seeming inept at times.
0 Kudos
4 REPLIES 4
squirreltown
Roku Guru

Re: How to create a timer? (without xml)

  
mytimer = createObject("roTimespan")
? mytimer.totalmilliseconds()

Well that's a timer in B/S. But It sounds like you actually want to use the SG (XML) stuff so maybe start a thread to get that solved and this problem will go away.
Kinetics Screensavers
0 Kudos
scaper12123
Visitor

Re: How to create a timer? (without xml)

"squirreltown" wrote:
  
mytimer = createObject("roTimespan")
? mytimer.totalmilliseconds()

Well that's a timer in B/S. But It sounds like you actually want to use the SG (XML) stuff so maybe start a thread to get that solved and this problem will go away.


That helps a little. The reason I can't use xml is because the slightest thing breaks it and I have no way of properly debugging it, because the console tells me I have to view another port for the details but I don't know how to access that port.
I AM THE ARCHMAGE... who is also rather new to Brightscript so forgive me for seeming inept at times.
0 Kudos
Komag
Roku Guru

Re: How to create a timer? (without xml)

Uh, what?
0 Kudos
EnTerr
Roku Guru

Re: How to create a timer? (without xml)

... Or: what else is new? 😄
0 Kudos