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: 
btpoole
Channel Surfer

No Such Node

From what I understand, a task can not be ran from the main.brs file. So in order to run a task, I must first create a scene and then create the task within the scene. If this is not correct I am really lost.  So, in my main.brs I have a function that is executed on start up and then again later in the code. This function uses urlTransfer so it's done in a task. My problem is that I keep getting an error stating "No such node serverurlinfo". I have a setup like the following;

main.brs

function seturlData()
screen = CreateObject("roSGScreen")
screen.setMessagePort(m.port)
scene = screen.CreateScene("serverurlinfo")
screen.show()

    while (true)
      msg = wait(0, m.port)
        msgType = type(msg)
       if msgType = "roSGScreenEvent"
          if msg.isScreenClosed()
            exit while
          end if
        end if
        end while

end function


serverurlinfo.xml

<?xml version="1.0" encoding="utf-8" ?>

<component name="serverurlinfo" extends="Scene" >
<script type="text/brightscript" uri="pkg:/source/main.brs" />
<script type="text/brightscript">


  <![CDATA[
  sub init()
  url="http://xxx.xx.xx.xx:8xxx/server"
  m.urlTask = CreateObject("roSGNode", "urlTask")
  m.urlTask.serverurl= url
    m.urlTask.control = "RUN"
  end sub
  ]]>
  </script>
[size=85][font=Helvetica Neue, Helvetica, Arial, sans-serif]</component>[/font][/size]


task_url.xml

<?xml version="1.0" encoding="utf-8" ?>
<!--********** Copyright 2016 Roku Corp.  All Rights Reserved. **********-->
<component name = "urlTask" extends = "Task" >
  <interface>
<field id = "serverurl" type= "string"/>
<field id = "contentreturn" type = "roArray"/>
    </interface>
 <script type="text/brightscript" uri="pkg:/source/main.brs" />
 <script type = "text/brightscript" >
    <![CDATA[

    sub init()
PRINT "IN url  TASK"
TransferServer()
end sub

function TransferServer()
?"in TransferServer"
serverurl=m.top.url
rocurl = createObject("roUrlTransfer")
roport=CreateObject("roMessagePort")
rocurl.setUrl(serverurl)
m.top.contentreturn=rocurl.GetToString()
end function

]]>
  </script>

</component>

Is there something missing? If so what? Thanks
0 Kudos
1 REPLY 1
btpoole
Channel Surfer

Re: No Such Node

Update: I moved the scene xml and other files associated outside of the source folder into folder of their own. Error goes away.
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.