<component name = "SignInScene" extends = "Scene" >
<script type = "text/brightscript" >
<![CDATA[
sub init()
m.communicator = m.top.findNode("communicator")
m.communicator.addField("password", "roString", true)
...
end sub
sub onPasswordKeyboardBtnSelected(roEvent)
if roEvent.getData() = 0 then
if m.password <> "" and m.password <> invalid then
m.communicator.setField("password", m.password)
...
end if
end if
end sub
<children>
<Label id="communicator"/>
</children>
</component>
screen = CreateObject("roSGScreen")
m.port = [i]CreateObject[/i]("roMessagePort")
screen.setMessagePort(m.port)
scene = screen.CreateScene("SignInScene")
screen.Show()
scene.findNode("communicator").observeField("password", m.port)
while (true)
msg = wait(0, m.port)
msgType = type(msg)
LogToConsole(msgType)
if msgType = "roSGScreenEvent"
if msg.isScreenClosed() then return
end if
end while
<children>
<Label id="password" translation="[0,0]" text="" visible="false" />
</children>
password = m.top.findNode("password")
...
password.text = "user's password"
sg = createObject("roSGScreen")
scene = sg.createScene("SignInScene")
sg.Show()
sg.setMessagePort(m.port)
password = scene.findNode("password")
password.observeField("text", m.port)
while(true)
msg = wait(0,m.port)
msgType = type(msg)
print "msgType: ";msgType
if msgType = "roSGScreenEvent" then
if msg.isScreenClosed() then
print "isScreenClosed"
exit while
end if
else if msgType = "roSGNodeEvent" then
passwordText = password.text
end if
end while
We’re upgrading Roku Community to bring you a faster, more mobile-friendly experience. You may notice limited functionality or read-only access during this time. Read more here.
Planned Downtime:
Community will be unavailable for up to 24–48 hours during the upgrade window during the week of May 19th and you may notice reduced functionality.
In the meantime, for additional assistance, visit our Support Site.
We're sorry for this disruption — we’re excited to share what’s next!