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.