Here is the code for the Main.brs
Library "Roku_Ads.brs"
sub main()
m.screen = CreateObject("roSGScreen")
m.port = CreateObject("roMessagePort")
m.screen.SetMessagePort(m.port)
m.scene = m.screen.CreateScene("HomeScene")
m.screen.Show()
while true
msg = wait(0, m.port)
print "------------------"
print "msg = "; msg
end while
if m.screen <> invalid then
m.screen.Close()
m.screen = invalid
end if
End Sub
and here is my first component code
Sub Init()
' listen on port 8089
? "[HomeScene] Init"
'
'main grid screen node
m.GridScreen = m.top.findNode("GridScreen")
'video player node
m.videoPlayer = m.top.findNode("videoPlayer")
'added handler on item selecting event in grid screen
m.top.observeField("rowItemSelected", "OnRowItemSelected")
m.top.observeField("navBarItemSelected","OnNavItemSelected")
' loading indicator starts at initializatio of channel
m.loadingIndicator = m.top.findNode("loadingIndicator")
m.overhangNavBar = m.top.findNode("overhangNavBar")
'Get Page Contents'
getPages()
' Create another buff content to make sure indicator works properly'
m.content = CreateObject("RoSGNode", "ContentNode")
End sub
I swear to god it only have one Init method in my components.
And after all, it doesnt make any sense to me why same clean clone version on my computer will have the sub duplicate issue while change to my friend's computer it is able to run.
well, I m not sure if include
Library "Roku_Ads.brs"
"
will generate some hidden file?
Because I wrongly put this "Import" statement in the "homeScene.brs" at first. That s the only reason I can think of and if that is the case, I really wanna know where I can delete those hidden fileds