If the code you've shown is a copy and paste then you have a typo:
Should be buttonSelected.
But that's not the only problem. Even if you fix the line, add a print in front of it and I bet it prints out false meaning the statement failed and your observer will never be called.
print m.exitDialog.observeField("buttonSelected", "onButtonSelected")
That "buttonSelected" needs to be attached to a component. I'm not sure how to accomplish that; I've only ever done it via an interface alias in the XML file for the node/group/component or whatever it's called.
print m.top.observeField("button_selected", "onButtonSelected")
I tried a quick test trying to add it to the code you have, but I couldn't come up with the right way to specify it or I had some other problem with the code since it's not complete.
As for observeField vs observeFieldScoped, I've wondered the same thing, but I've never taken the time to investigate it.
I have to include my standard caveat: As I've stated many times, I'm not the person to ask about scene graph as I absolutely hate it. Maybe if I
wasted took the time to learn more than the bare minimum I wouldn't hate it so much, but I don't see that ever happening.
Roku Community Streaming Expert
Help others find this answer and click "Accept as Solution."
If you appreciate my answer, maybe give me a Kudo.
I am not a Roku employee.