Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Taurian
Visitor

Calling a function from main.brs

Hi, I have a dumb question. I'm trying to call a function from main.brs, getting the usual error about it unable to see it.


//main.brs
scene = screen.CreateScene("HomeScene") //Function is located in the "HomeScene.brs, not the .xml"
scene.myfunction() <-- Error


Thanks,

-T
0 Kudos
2 REPLIES 2
joetesta
Roku Guru

Re: Calling a function from main.brs

did you try this?
https://sdkdocs.roku.com/display/sdkdoc/interface

Add to your HomeScene xml:
<interface>
   <function name="myfunction" />
</interface>


Does it work from scene?
aspiring
0 Kudos
Taurian
Visitor

Re: Calling a function from main.brs

No, but that did lead me to this:
https://sdkdocs.roku.com/display/sdkdoc ... onalFields

and this:
scene.callFunc("myfunction")

Thanks.
0 Kudos