JSON解析与Brightscript
问题描述:
我试图解析JSON的基础上,这里的例子:http://blog.roku.com/developer/2012/07/16/json-support-comes-to-roku/JSON解析与Brightscript
jsonAsString = ReadAsciiFile("pkg:/json/sample1.json")
m.json = ParseJSON(jsonAsString)
ShowPosterScreen(m.json.Videos, true)
我得到的调试器控制台此消息:
Current Function:
057: Function LoadJSONFile() as void
058: jsonAsString = ReadAsciiFile("pkg:/json/sample1.json")
059: m.json = ParseJSON(jsonAsString)
060: ShowPosterScreen(m.json.Videos, true)
061: End Function
'Dot' Operator attempted with invalid BrightScript Component or interface reference. (runtime error &hec) in ...AALAE4Bk/pkg:/source/main.brs(60)
060: ShowPosterScreen(m.json.Videos, true)
Backtrace:
Function loadjsonfile() As
file/line: /tmp/plugin/D...AALAE4Bk/pkg:/source/main.brs(60)
Function handlebuttonpress(id As Integer) As
file/line: /tmp/plugin/D...AALAE4Bk/pkg:/source/main.brs(51)
Function main() As
file/line: /tmp/plugin/D...AALAE4Bk/pkg:/source/main.brs(26)
Local Variables:
global &h0020 rotINTERFACE:ifGlobal
m &h0010 bsc:roAssociativeArray, refcnt=4
jsonasstring &h8010 bsc:roString (2.1 was String), refcnt=1
BrightScript Debugger>
更新:如果我有一个Makefile并压缩内容,并通过开发浏览器加载...它的工作原理。通过Eclipse导出时不起作用。
答
这听起来像某种Eclipse Brightscript插件中的错误,很可能在某种程度上它不会加载包含ShowPosterScreen函数的文件。
请检查Roku Developer论坛,最顶端是讨论Eclipse插件的部分。 Here is a direct link.
它必须是Eclipse中的一个错误,即使我拥有所有最新的。我说的是,在Makefile和压缩内容以通过浏览器加载后,我能够运行它。谢谢。 – taraloca