Forum Discussion

scaper12123's avatar
9 years ago

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).

4 Replies

  •   
    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.
  • "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.