Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
radargaming
Visitor

Getting Rid of Categories/Category Leaf

Using the example videoplayer. I want to get rid of the Category Leaf so that when I click the category It directly brings me to the video of choice. So from the home screen users can click one and the video screen will open. Can this be done?
0 Kudos
7 REPLIES 7
joetesta
Roku Guru

Re: Getting Rid of Categories/Category Leaf

yes.
I know it's not exactly what you asked but I wrote a post about removing one level of categories, that may help you understand what you need to change if you can follow viewtopic.php?f=34&t=26563#p304237
aspiring
0 Kudos
radargaming
Visitor

Re: Getting Rid of Categories/Category Leaf

Hello Joe,

I followed the all the instructions and Im still getting this error. If you have any idea how to fix this any help would be great!

Thanks
showHomeScreen | msg =  | index =  0
showHomeScreen | msg = | index = 0
list item selected | index = 0
Current Function:
034: Function showPosterScreen(screen As Object, category As Object) As Integer
035:
036: if validateParam(screen, "roPosterScreen", "showPosterScreen") = false return -1
037: if validateParam(category, "roAssociativeArray", "showPosterScreen") = false return -1
038:
039: m.curCategory = 0
040: m.curShow = 0
041: temp=getcategorylist(category)
042:
043:
044: if temp.count() > 1 then
045: screen.SetListNames(temp)
046: ?temp.count();" categories"
047: else
048: ?"only ";temp.count();" category"
049: end if
050: screen.SetContentList(getShowsForCategoryItem(category, m.curCategory))
051: screen.Show()
052:
053: while true
054: msg = wait(0, screen.GetMessagePort())
055: if type(msg) = "roPosterScreenEvent" then
056: print "showPosterScreen | msg = "; msg.GetMessage() " | index = "; msg.GetIndex()
057: if msg.isListFocused() then
058: m.curCategory = msg.GetIndex()
059: m.curShow = 0
060: screen.setcontentlist([])
061: screen.SetFocusedListItem(m.curShow)
062: screen.showmessage("Retrieving")
063: screen.SetContentList(getShowsForCategoryItem(category, m.c urCategory))
064: screen.clearmessage()
065: print "list focused | current category = "; m.cu rCategory
066: else if msg.isListItemSelected() then
067: m.curShow = msg.GetIndex()
068: print "list item selected | current show = "; m.curShow
069: m.curShow = displayShowDetailScreen(category, m.curShow)
070: screen.SetFocusedListItem(m.curShow)
071: print "list item updated | new show = "; m.curShow
072: else if msg.isScreenClosed() then
073: return -1
074: end if
075: end If
076: end while
077:
078:
079: End Function
Member function not found in BrightScript Component or interface. (runtime error &hf4) in ...g:/source/appPosterScreen.brs(44)

044: if temp.count() > 1 then
Backtrace:
Function showposterscreen(screen As <uninitialized>, category As <uninitialized> ) As Integer
file/line: /tmp/plugin/FJAAAA8C8mmt...g:/source/appPosterScreen.brs(44)
Function displaycategoryposterscreen(category As <uninitialized>) As
file/line: /tmp/plugin/FJAAAA8C8mmt/pkg:/source/appHomeScreen.brs(79)
Function showhomescreen(screen As ) As Integer
file/line: /tmp/plugin/FJAAAA8C8mmt/pkg:/source/appHomeScreen.brs(56)
Function main() As
file/line: /tmp/plugin/FJAAAA8C8mmt/pkg:/source/appMain.brs(20)

Local Variables:
screen &h0010 bsc:roPosterScreen, refcnt=2
category &h4010 bsc:roAssociativeArray, refcnt=5
global &h0020 rotINTERFACE:ifGlobal
m &h0010 bsc:roAssociativeArray, refcnt=5
temp &h4010 bsc:roAssociativeArray, refcnt=5
msg &h0000 <uninitialized> val:Uninitialized
BrightScript Debugger> Note: GC - Found 16 orphaned objects (objects in a circul ar ref loop).

0 Kudos
joetesta
Roku Guru

Re: Getting Rid of Categories/Category Leaf

hi radargaming -sorry it took so long before I saw your response!
"radargaming" wrote:

Member function not found in BrightScript Component or interface. (runtime error &hf4) in ...g:/source/appPosterScreen.brs(44)

044: if temp.count() > 1 then


I think that error "Member function not found" must be caused by some bad characters that got copied and pasted (&hf4 ? )

I would check / overwrite all the white space with actual spaces to make sure. It looks like some of the lines got broken up with extra white space, for example
063: screen.SetContentList(getShowsForCategoryItem(category, m.c urCategory)
so make sure to put those back together; there should be no space between the "c" and "urCategory" in this example.
aspiring
0 Kudos
RokuMarkn
Visitor

Re: Getting Rid of Categories/Category Leaf

Here's how I analyze this error.

First look at the actual error message, just after the dump of the function:

Member function not found in BrightScript Component or interface. (runtime error &hf4) in ...g:/source/appPosterScreen.brs(44)

This says that we tried to call a function using the dot operator on an object, in this case temp.count(), but there was no such function in the object. That suggest we should look at temp and see what it is. In the list of Local Variables we see

temp &h4010 bsc:roAssociativeArray, refcnt=5

We see that temp is an roAssociativeArray. However from reading the code, it seems that the author expected temp to be an roArray. So this directs our attention to the getcategorylist() function which created temp. It seems to have returned the wrong type of object. But since we don't have the source of that function, that's as far as we can go.

--Mark
0 Kudos
joetesta
Roku Guru

Re: Getting Rid of Categories/Category Leaf

Thanks Mark
is it the dot immediately after "interface" that tells you the dot operator failed?

I see the code in my earlier post:
and also in appPosterScreen.brs change this

categoryList = CreateObject("roArray", 100, true)
for each subCategory in topCategory.Kids
categoryList.Push(subcategory.Title)
next
return categoryList

to this

categoryList = CreateObject("roArray", 100, true)
categoryList = topCategory
return categoryList


looks like my error was that categoryList gets overwritten with topCategory, so not sure how it ever worked, something else must've changed as well, I'll try to figure it out later. Thanks for your help Mark.
aspiring
0 Kudos
RokuMarkn
Visitor

Re: Getting Rid of Categories/Category Leaf

"joetesta" wrote:
Thanks Mark
is it the dot immediately after "interface" that tells you the dot operator failed?


No, it's the message "Member function not found". The dot operator is what accesses a member (of a component or AA).

--Mark
0 Kudos
joetesta
Roku Guru

Re: Getting Rid of Categories/Category Leaf

Thanks Mark.
Not sure if the OP is still interested, but a solution is to use this code in appPosterScreen.brs:
    categoryList = CreateObject("roArray", 100, true)
categoryList.Push(topCategory)
return categoryList

If nobody minds, I will follow up with a post containing the concise instructions for doing this, since it seems to come up now and then.
-Joe
aspiring
0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.