I have made the homescreen using the posterscreen sample
' *********************************************************
' ** Simple Poster Screen Demonstration App
' ** Nov 2009
' ** Copyright (c) 2009 Roku Inc. All Rights Reserved.
' *********************************************************
'************************************************************
'** Application startup
'************************************************************
Function Main() as void
menuFunctions = [ShowBonanzaMenu, ShowMovieMenu]
'initialize theme attributes like titles, logos and overhang color
initTheme()
port=CreateObject("roMessagePort")
screen = CreateObject("roPosterScreen")
screen.SetMessagePort(port)
screen.SetListStyle("arced-landscape")
contentList = InitContentList()
screen.SetContent(contentList)
screen.Show()
while (true)
msg = wait(0, port)
if (type(msg) = "roPosterScreenEvent")
if (msg.isListItemSelected())
menuFunctions[msg.GetIndex()]()
endif
endif
end while
End Function
'*************************************************************
'** Set the configurable theme attributes for the application
'**
'** Configure the custom overhang and Logo attributes
'** These attributes affect the branding of the application
'** and are artwork, colors and offsets specific to the app
'*************************************************************
Sub initTheme()
app = CreateObject("roAppManager")
theme = CreateObject("roAssociativeArray")
theme.OverhangOffsetSD_X = "72"
theme.OverhangOffsetSD_Y = "25"
theme.OverhangSliceSD = "pkg:/images/Overhang_BackgroundSlice_Blue_SD43.png"
theme.OverhangLogoSD = "pkg:/images/Logo_Overhang_Roku_SDK_SD43.png"
theme.OverhangOffsetHD_X = "123"
theme.OverhangOffsetHD_Y = "48"
theme.OverhangSliceHD = "pkg:/images/Overhang_BackgroundSlice_Blue_HD.png"
theme.OverhangLogoHD = "pkg:/images/Logo_Overhang_Roku_SDK_HD.png"
app.SetTheme(theme)
End Sub
Function displayBase64()
ba = CreateObject("roByteArray")
str = "Aladdin:open sesame"
ba.FromAsciiString(str)
result = ba.ToBase64String()
print result
ba2 = CreateObject("roByteArray")
ba2.FromBase64String(result)
result2 = ba2.ToAsciiString()
print result2
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 InitContentList() As Object
contentList = [
{
ShortDescriptionLine1:"Bonanza",
ShortDescriptionLine2:"A story about a man and his three sons living in a ranch called the Ponderosa",
HDPosterUrl:"pkg:/media/bogusFileName_hd.jpg",
SDPosterUrl:"pkg:/media/bogusFileName_hd.jpg"
}
{
ShortDescriptionLine1:"Movies",
ShortDescriptionLine2:"Pop some corn, get a soda and check out some flix",
HDPosterUrl:"pkg:/media/bogusFileName_hd.jpg",
SDPosterUrl:"pkg:/media/bogusFileName_hd.jpg"
}
]
return contentList
End Function
The main problem is that I keep getting this error
Member function not found in BrightScript Component or interface. (runtime error
&hf4) in pkg:/source/Main.brs(22)
Now this code worked before and I don’t know why it wont now
“squirreltown” wrote:
I’m going to guess and say that
if (type(msg) = "roPosterScreenEvent")
is causing it. Should be no parentheses around “type” or at the end. Same here.
if (msg.isListItemSelected())
Extra parenthesis are fine, won’t cause error. I don’t see how the 1st line can cause the problem, so it must be the 2nd one.
And one more thing: something’s wrong with the way Blackhawk posts code because there are is 1 extra empty line after every line of code, so we have to try and guess what was the line#.
“EnTerr” wrote:
And one more thing: something’s wrong with the way Blackhawk posts code because there are is 1 extra empty line after every line of code, so we have to try and guess what was the line#.
Count the actual code lines aka skip comments and white spaces then stop at 22.
“EnTerr” wrote:
And one more thing: something’s wrong with the way Blackhawk posts code because there are is 1 extra empty line after every line of code, so we have to try and guess what was the line#.
Count the actual code lines aka skip comments and white spaces then stop at 22.
I think if you are taking the time to answer, you shouldn’t have to count. It’s courtesy.
“Tajson” wrote:
Count the actual code lines aka skip comments and white spaces then stop at 22.
Oh yeah. I am totally going to do that!
A bit more serious - i have done that - but really people, this forum is staffed by volunteers only (unfortunately) - so if you want help, make it easy on the helpers
As a minimum, at least post the actual, complete debugger output from the time of the crash, including the “list” command output, which will list the current file, including line numbers.
“Tajson” wrote:
Count the actual code lines aka skip comments and white spaces then stop at 22.
Oh yeah. I am totally going to do that!
A bit more serious - i have done that - but really people, this forum is staffed by volunteers only (unfortunately) - so if you want help, make it easy on the helpers
I was replying to you since your statement hinted it would be guesswork to find the line while you can eliminate the guesswork by logic. Granted, I agree that topic author could have been more helpful with his/her post.
The error shows:
Member function not found in BrightScript Component or interface. (runtime error
&hf4) in pkg:/source/Main.brs(22)
022: screen.SetContent(contentList)
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())
“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.