Forum Discussion

johnmarsden's avatar
9 years ago

Accessing global functions in SceneGraph components?

Hey there,

How do you access global functions from within Scene Graph *.brs files? I have a utility class that has things like toString(), getScreenHeight(), etc that I want to access. 
' source/utility/general.brs

function toString(var)
  return ...
end function



There's a component being included called Menu.xml, which reaches out to a Menu.brs class that has a "init()" function. I've tried things like 
m.global.toString("test")
m.top.toString("test")
m.toString("test")
toString("test")


But none of it works. What's the best approach for accessing global utility functions from within components?
Thanks!

11 Replies