Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
btpoole
Channel Surfer

keyboarddialog Crashing

Something odd. I have a pin pad where user inputs a code, if the correct etc it calls a keyboard to come up to enter other info. This all worked when I used onkeyevent but have since changed to using an observer on the buttonselected. The pin pad works and enters the keyboard function. I have REM out each line to isolate the crash. Whenever it gets to m.top.dialog=keyboarddialog the code crashes and reboots. I get no error on the debugger. The code looks as follows

function setcode()
pindialog = createObject("roSGNode", "PinDialog")
pindialog.title = "Enter 5 DIGIT CODE"
pindialog.optionsDialog = false
pindialog.buttons=["OK","Cancel"]
pindialog.observeField("buttonSelected","checkbutton")
m.pad=pindialog.pinPad
m.pad.pinLength=5
m.pad.secureMode=false
m.top.dialog = pindialog
m.top.setFocus(TRUE)
end function


function checkbutton
function checkbutton()
?"in checkbutton"
?m.top.dialog.buttonSelected
if m.top.dialog.buttonSelected= 0 and len(m.top.dialog.pin)=5
?"CODE "m.top.dialog.pin
m.top.unobserveField("buttonSelected")
m.top.dialog.close = true
setpass()
else
end if
end function


function setpass()

function setpass()
keyboarddialog = createObject("roSGNode", "KeyboardDialog")
keyboarddialog.title= "Enter Phrase"
keyboarddialog.visible = true
keyboarddialog.buttons=["OK","Cancel"]
keyboarddialog.observeField("buttonSelected","statecheckbutton")
m.key=keyboarddialog.keyboard
m.key.showTextEditBox= true
m.top.dialog=keyboarddialog    'CRASH OCCURS HERE
m.top.setFocus(true)
end function


Any ideas? Like I said worked with  onKeyEvent but needed to get away from that and use observerfield. All of this takes place in a Scene. Thanks for any advice.
0 Kudos
6 REPLIES 6
areinart
Visitor

Re: keyboarddialog Crashing

Have you fixed this yet? I have this issue as well.
0 Kudos
btpoole
Channel Surfer

Re: keyboarddialog Crashing

No luck in fixing it as is. I ended up breaking it out into 2 separate scenes to work. Really odd it works like that but not as written in the post.
0 Kudos
areinart
Visitor

Re: keyboarddialog Crashing

Oh ok so you had your Keyboard scene and Pin scene. After user pressed the "OK" from the keyboard scene it would go to the Pin scene. Something like that?
0 Kudos
btpoole
Channel Surfer

Re: keyboarddialog Crashing

Yes, actually pin came first then keyboard. It worked before the 7.6 update stuff came out. After that it would not, just crashed. 
0 Kudos
areinart
Visitor

Re: keyboarddialog Crashing

Is there a possibility I could see the code? I'm sorry I am new to programming in brightscript.
0 Kudos
btpoole
Channel Surfer

Re: keyboarddialog Crashing

"areinart" wrote:
Is there a possibility I could see the code? I'm sorry I am new to programming in brightscript.

sent you pm
0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.