Currently messageports aren't able to be cloned (per sdk)
https://sdkdocs.roku.com/display/sdkdoc ... ph+ThreadsAn interesting idea you have here. I did try using a variable to pass along in the callback for an observer and it fails - I would think this ought to work but it doesn't.
ie -
m.b1=m.searchscreen.getChild(1) 'reference to a button that has focus
m.b1.id="search"
m.b1.text="Search"
m.b1.showFocusFootprint=FALSE
m.b1.translation=[164,670]
m.b1.observeField("buttonSelected","ButtonHandler(m.b1.id)")
m.b1.SetFocus(TRUE)
Function ButtonHandler(Name As String)
m.b1.unobserveField("buttonSelected")
Print Name
End Function
------------------------------------------------------
If I change it to
m.b1=m.searchscreen.getChild(1) 'reference to a button that has focus
m.b1.id="search"
m.b1.text="Search"
m.b1.showFocusFootprint=FALSE
m.b1.translation=[164,670]
m.b1.observeField("buttonSelected","ButtonHandler")
m.b1.SetFocus(TRUE)
Function ButtonHandler()
m.b1.unobserveField("buttonSelected")
Print "Button Selected"
End Function
Then the callback works. But still, it would be nice to be able to minimize extra code, enhance program flow, and use one callback function for anything needing to be done IMO.