Hello everyone,
Is there any way to store roAssociativeArray with function references using Scene Graph API and m.global node?
In my tests all function references become "invalid" when added to m.global (or any other node) by using addFields function (I guess it is by design,because function is not a field and it is silently ignored).
But a good part of my codebase is relies on that.
When I was using previous Roku API, I was able to do things like this:
Function GetAAWithFunctionReferences() as object
aa = {
test1: test1, ' function reference
string1: "test string 1"
}
return aa
End Function
Function test1()
print m.string1
End Function
aa debugger output:
aa = GetAAWithFunctionReferences()
print aa
<Component: roAssociativeArray> =
{
string1: test string 1
test1: <Function: test1>
}
m.global.testaa debugger output:
m.global.addFields({testaa: aa})
print m.global.testaa
<Component: roAssociativeArray> =
{
string1: test string 1
test1: invalid
}
Previously it was stored in Main.brs, and accessed using GetGlobalAA() with no issues with function references.
Is there any other global storage available? Or can I still use GetGlobalAA() from a Task node somehow?