pkg:/components/videoDetailScene.xml
<?xml version="1.0" encoding="utf-8" ?>
<component name="videoDetailScene" extends="Scene" >
<interface>
<field id = "workid" type = "integer" onChange = "SetWorkid" />
</interface>
<script type="text/brightscript" uri="pkg:/components/videoDetailScene.brs" />
</component>
pkg:/components/videoDetailScene.brs
sub init()
' you should see 20000 in the debug output
print m.top.workid
end sub
'alternatively, because we set an onChange listener, whenever workid is changed it will call this function (even after the component is initialized)
sub SetWorkid()
' you should see 20000 in the debug output
print m.top.workid
end sub
pkg:/source/main.brs
sub Main(external_params as object)
scene = screen.CreateScene("videoDetailScene")
scene.setField("workid", "20000")
screen.show()
end sub