I have set up the following Task:
<?xml version="1.0" encoding="utf-8" ?>
<!--********** Copyright 2015 Roku Corp. All Rights Reserved. **********-->
<component name="launchSceneTask" extends="Task" >
<interface>
<field id="scene" type="string" />
<field id="video_key" type="string" />
</interface>
<script type="text/brightscript" >
<![CDATA[
sub init()
m.top.functionName = "showSGScene"
end sub
sub showSGScene()
print "in showSGScene"
screen = CreateObject("roSGScreen")
m.port = CreateObject("roMessagePort")
screen.setMessagePort(m.port)
scene = screen.CreateScene(m.top.scene)
print "VIDEO KEY:"
print m.top.video_key
screen.show()
while(true)
msg = wait(0, m.port)
msgType = type(msg)
if msgType = "roSGScreenEvent"
if msg.isScreenClosed() then return
end if
end while
end sub
]]>
</script>
</component>
And am calling it like so:
function showWatchSGScreen(video_key as String)
m.sceneTask = CreateObject("roSGNode", "launchSceneTask")
m.sceneTask.setField("scene", "watchScene")
m.sceneTask.setField("video_key", video_key)
m.sceneTask.ObserveField("test_trigger", "testFunction")
m.sceneTask.control = "RUN"
end function
However, I get the following error:
Interface not a member of BrightScript Component (runtime error &hf3) in ...A2pJLT7/pkg:/components/homeScene.xml(97)
097: m.sceneTask.setField("scene", "watchScene")
The examples in the documentation seem to be doing it exactly this way. Is there a bug, or is this user error?