Hi Roku lovers,
i'm trying to put a global object full of functions and attributes that allows the app to report videoplayer events and app events to Google Analytics, the app uses SceneGraph
i've tried put the object into 'm.global' on 'main.brs' file, but the scope is not global, it only works on that file.
i've tried to create a notification port and listen to it, but when setting 'm.port' on player.ObserveField("position","m.port") in another file, the 'm.port' property is invalid, again a scope problem.
The custom object has the following structure:
function GA() as Object
return{
init : function (init_args) as Void
//init code
end function
func_1 : function()
end function
'and many other functions to report events
}
there is one method that will receive all the notifications "handleScenegraphEvent", notification in form of messages of node.ObserveField
i've tried putting the object into 'm' as follows in 'main.brs':
gareporter = GA()
gareporter.init("UAID123456","RokuEvent[size=100]")[/size]
m.reporter ={}
m.reporter = gareporter
and
m.addField("reporter","asocarray",true)
gareporter = GA()
gareporter.init("UAID123456","FusionRoku")
m.reporter = gareporter
while working on the same file the property 'm.reporter' is accesible, but when the code is coming from another file, the property is null.
i hope the question is clear enough to give me some hints.
Thanks for your help
~ Carlos ~