Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
cancel
Showing results for 
Search instead for 
Did you mean: 
hugetv
Level 7

help this error

    jsonAsString = CreateObject("roUrlTransfer")
jsonAsString.SetURL("http://"+initConfig()+"/RokuDev/season.php?cve=10&Series=season 1")
json = ParseJson(jsonAsString.GetToString())
return json.Capitulos


Operator attempted with invalid BrightScript Component or interface reference. (runtime error &hec) in pkg:/source/Series/PosterScreen.brs(53)

this error spache for season 1
Our system http://www.rokumanager.com
0 Kudos
1 Reply
Roku Employee
Roku Employee

Re: help this error

"hugetv" wrote:
    jsonAsString = CreateObject("roUrlTransfer")
jsonAsString.SetURL("http://"+initConfig()+"/RokuDev/season.php?cve=10&Series=season 1")
json = ParseJson(jsonAsString.GetToString())
return json.Capitulos


Operator attempted with invalid BrightScript Component or interface reference. (runtime error &hec) in pkg:/source/Series/PosterScreen.brs(53)

this error spache for season 1


For debugging purposes, you could break up your code into steps and verify each step.
E.g.

jsonAsString = CreateObject("roUrlTransfer")
jsonAsString.SetURL("http://"+initConfig()+"/RokuDev/season.php?cve=10&Series=season 1")

data = jsonAsString.GetToString()
print "Data: "; data
' did the data download succeed? if not, and it is empty or not JSON, ParseJSON is going to fail...

json = ParseJson(data)
print "JSON: "; json
' did the JSON parse successfully and return an object, or is it invalid?
' and does if have a Capitulos field as expected?

return json.Capitulos
0 Kudos