I am trying to create a bunch of callback functions that are in an Associative Array, which then is saved to another Scenegraph object's interface field.
However, when accessing the interface field in the same object, it states that the function is invalid.
Object 1:
callbacks = {
afterchildcreatecallback: function ()
print "THIS IS A CALLBACK FUNCTION"
return 1
end function
}
m.contentReader = createObject("roSGNode", "ContentReader")
m.contentReader.observeField("content", "setLists")
m.contentReader.contenturi = "pkg:/data/contentLists/" + settingFocused.id + "Data.xml"
m.contentReader.callbacks = callbacks
m.contentReader.control = "RUN"
Object 2:
<component name = "ContentReader" extends = "Task" >
<script type = "text/brightscript" uri="pkg:/components/taskRunners/contentReader.brs"></script>
<interface>
<field id = "contenturi" type = "uri"></field>
<field id = "content" type = "node"></field>
<field id = "callbacks" type = "assocarray"></field>
</interface>
</component>
When accessing the callbacks field in Object 2, I can see the added object but the function that was defined inside it, is invalid.
Is this allowed? Or do I have to pass the function through a `setter` method?