
georgejecook
Streaming Star
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2018
05:57 PM
trying to use callfunc in a useful way
I have the typical 1 screen, 1 scene setup. i.e. 1 screen owns many group ("scene") children.
Like this
SCREEN (main.brs)
MAINSCENE (mainscene.xml/mainscene.brs)
CHILD1
CHILD2
Now, I expose interface functions on MAINSCENE "test". I would very much like to be able to callfunc on them.
It tired doing this in mainscene.brs
m.global.AddFields({utils:m});
then in CHILD1
m.global.utils.callFunc("test","hello world")
but this doesn't work...
does anyone have a solution to this? From my reading, and seeing some other posts, I expected this to work.
Like this
SCREEN (main.brs)
MAINSCENE (mainscene.xml/mainscene.brs)
CHILD1
CHILD2
Now, I expose interface functions on MAINSCENE "test". I would very much like to be able to callfunc on them.
It tired doing this in mainscene.brs
m.global.AddFields({utils:m});
then in CHILD1
m.global.utils.callFunc("test","hello world")
but this doesn't work...
does anyone have a solution to this? From my reading, and seeing some other posts, I expected this to work.
George Cook
https://georgejecook.github.io/
https://linkedin.com/in/georgejecook/
Roku developers slack group (https://join.slack.com/t/rokudevelopers/shared_invite/zt-4vw7rg6v-NH46oY7hTktpRIBM_zGvwA) : georgejecook
Contact me on roku developer slack group, or via pm to discuss consultancy/work opportunities/rooibos unit testing framework
https://georgejecook.github.io/
https://linkedin.com/in/georgejecook/
Roku developers slack group (https://join.slack.com/t/rokudevelopers/shared_invite/zt-4vw7rg6v-NH46oY7hTktpRIBM_zGvwA) : georgejecook
Contact me on roku developer slack group, or via pm to discuss consultancy/work opportunities/rooibos unit testing framework
1 REPLY 1
Tyler_Smith
Streaming Star
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2018
06:05 PM
Re: trying to use callfunc in a useful way
You can access functions in your main scene via m.top.getScene()
m.top.getScene().callFunc("test","hello!") should work.
m.top.getScene().callFunc("test","hello!") should work.
Tyler Smith