Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Level 18

Re: Member function not found in BrightScript Component or interface.

I'm guessing you want:
screen.SetContentList(contentList)
0 Kudos
Highlighted
Level 10

Re: Member function not found in BrightScript Component or interface.

Indeed, roPosterScreen doesn't have SetContent(), only SetContentList()
https://sdkdocs.roku.com/display/sdkdoc/ifPosterScreen
0 Kudos
Level 7

Re: Member function not found in BrightScript Component or interface.

 I tried the same with my movie menu

Function ShowMovieMenu() as integer

screen = CreateObject("roGridScreen")

port = CreateObject("roMessagePort")

screen.SetMessagePort(port)

screen.SetBreadcrumbText("Movie", "Full Menu")

screen.SetContentList(InitMovieList())

screen.SetFocusedListItem(2)

screen.Show()

while (true)

msg = wait(0, port)

if type(msg) = "roGridScreenEvent"

if (msg.isScreenClosed())

return -1

else if (msg.isListItemSelected())

ShowMovieDetailsScreen( msg.GetIndex() )

endif

endif



end while

End Function

Function ShowMovieDetailsScreen(index as integer) as integer
print "Selected Index: " + Stri(index)
detailsScreen = CreateObject("roSpringboardScreen")
port = CreateObject("roMessagePort")
detailsScreen.SetMessagePort(port)
detailsScreen.SetDescriptionStyle("generic")
detailsScreen.SetBreadcrumbText("Movies", m.options[index].Description)
detailsScreen.SetStaticRatingEnabled(false)

details = {
HDPosterUrl: m.options[index].HDPosterURL
SDPosterUrl: m.options[index].SDPosterURL
Description: m.options[index].Description
}
detailsScreen.SetContent(details)
detailsScreen.AddButton(1, "Play Movie")
detailsScreen.show()

while (true)
msg = wait(0, port)
if type(msg) = "roSpringboardScreenEvent"
if (msg.isScreenClosed())
return -1
else if (msg.isButtonPressed())
MovieDetailsScreenButtonClicked( msg.GetIndex() )
endif
endif
end while
End Function
Function MovieDetailsScreenButtonClicked(index as integer) as void
dialog = CreateObject("roOneLineDialog")
if (index = 1)
PlayVideo()
endif
dialog.ShowBusyAnimation()
dialog.show()

Sleep(4000)
End Function
 
'********************************************************************
'** Given the category from the filter banner, return an array
'** of ContentMetaData objects (roAssociativeArray's) representing
'** the shows for the category. For this example, we just cheat and
'** create and return a static array with just the minimal items
'** set, but ideally, you'd go to a feed service, fetch and parse
'** this data dynamically, so content for each category is dynamic
'********************************************************************
Function InitMovieList(category As Object) As Object
m.options = [

{
Title: category + ": Unit Bryan",
releaseDate: "",
rating: "",
Description:"A short film about bored, aimless retail store employee, Robin, who has been tasked with training the stores new employee, a friendly worker robot. Reluctant to work alongside this new machine at first, Robin forms an unlikely bond with it, leading her to make some life changing decisions.",
HDPosterUrl:"",
SDPosterUrl:"",
StarRating:100
}
{
Title: category + ": ZERO-DAY",
releaseDate: "",
rating: "",
Description:"After the success of STUXNET, a virus written by the United States to destroy Iranian uranium enrichment facilities, the U.S. government could no longer deny it was developing cyber weapons meant to do physical damage. With US companies and agencies under constant attack from state-sponsored Chinese hackers, it is only a matter of time before tensions boil over and more sensitive infrastructure is targeted. As more of our devices (cars, homes, etc) become connected, we will become more and more vulnerable to the physical threat of cyber warfare.",
HDPosterUrl:"",
SDPosterUrl:"",
StarRating:100
}
]
return m.options
End Function

Yet this error keeps showing up
Member function not found in BrightScript Component or interface. (runtime error
 &hf4) in pkg:/source/Movies.brs(19)
019:    screen.SetContentList(InitMovieList())
0 Kudos
Highlighted
Level 8

Re: Member function not found in BrightScript Component or interface.

"Blackhawk" wrote:
 I tried the same with my movie menu
Yet this error keeps showing up
Member function not found in BrightScript Component or interface. (runtime error
 &hf4) in pkg:/source/Movies.brs(19)
019:    screen.SetContentList(InitMovieList())

This is different so it is not the same as the previous issue.
0 Kudos
Highlighted
Level 7

Re: Member function not found in BrightScript Component or interface.

You've declared InitMovieList to take one parameter but you're calling it with no parameters.

--Mark
0 Kudos
Highlighted
Level 8

Re: Member function not found in BrightScript Component or interface.

and ifGridScreen.SetContentList takes 2 parameters, which is what the error you're getting is referring to.
https://github.com/belltown/
0 Kudos