bounce
Newbie
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-08-2019
07:21 PM
Brightscript Error
I am getting the following error... What would cause this...
BRIGHTSCRIPT: ERROR: roSGNode.ObserveField: no active host node: pkg:/source/API.brs(37)
How can I fix this? This is occuring in a task
The task runs but loginResult never is called.
BRIGHTSCRIPT: ERROR: roSGNode.ObserveField: no active host node: pkg:/source/API.brs(37)
How can I fix this? This is occuring in a task
function API__Login(userData as Object) as Boolean
result = true
print "Logging in user:"
account = userData
m.LoginTask = createObject("RoSGNode","LoginTask")
m.LoginTask.account = account
m.LoginTask.observeField("results","loginResult")
m.LoginTask.control = "RUN"
sleep(2000)
return result
end function
sub loginResult()
if m.LoginTask.results.user.id <> invalid then
print "registry write"
RegWrite("stuff",m.LoginTask.results.user.stuff)
end if
end sub
The task runs but loginResult never is called.
1 REPLY 1
joetesta
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-13-2019
12:21 PM
Re: Brightscript Error
You should remove the lines:
The "return" is breaking things for you, and there's no need for the "sleep".
In your callback you could print out
to make sure you're getting the response you expect. You might need to get the result's "body" instead... If the callback is never triggered then you need to debug your task and make sure it's setting its "m.top.results"
sleep(2000)
return result
The "return" is breaking things for you, and there's no need for the "sleep".
In your callback you could print out
print "results: "; m.LoginTask.results
to make sure you're getting the response you expect. You might need to get the result's "body" instead... If the callback is never triggered then you need to debug your task and make sure it's setting its "m.top.results"
aspiring