Have any of you experienced scoping issues with CallFunc since 8.1?
I have a component with an interface function, when i perform a component.callFunc(), sometimes there there are missing properties on m. For example, i define m.consts = {} in this components init and m.consts is referenced inside the interface function. Sometimes m.consts is accessible, other times the only thing on m is global and top.
Instances of this component are created in a loop in multiple controllers, and in the same way. For example:
for each tile in section.tiles
model = row_node.createChild("AssetModel")
model.content = tile
end for
Strangely, when CallFunc is called on an instance of this component (AssetModel), for example from ControllerA.brs, everything works as expected. But then when CallFunc is called on an instance of the component created in ControllerB.brs, no m.consts!
The interface function:FUNCTION GET_BOOKMARK(data as Object) as Integer
section = CreateObject("roRegistrySection", m.CONSTS.BOOKMARK.SECTION_KEY)
if section.Exists(m.top.id)
return section.Read(m.top.id).ToInt()
end if
return 0
END FUNCTION
Roku 2 XS 3100X