If you have custom component named "doWhateverScreen" and you would like to print a string passed down from a different component named "HomeScene" using function in "doWhateverScreen" component interface, this is how you would do it.
First in your doWhateverScreen.xml file add:
<interface>
<function name="doWhateverMan" />
</interface>
Now in doWhateverScreen.brs file add your "doWhateverMan" function:
Function doWhateverMan(param as String)
print param
End Function
Great, so far so good!Let us continue.
In your HomeScene.xml add this custom created "doWhateverScreen" screen/component and in HomeScene.brs init() function add:
m.doWhateverScreen= m.top.findNode("doWhateverScreen")
We can now call a function named "doWhateverMan" from HomeScene.brs with:
param = "Do Androids Dream of Electric Sheep?"
m.doWhateverScreen.callFunc("doWhateverMan",param)
That's it! Have a great day. :-D
Top comments (0)