Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
cancel
Showing results for 
Search instead for 
Did you mean: 
Blackhawk
Level 7

Member function not found in BrightScript Component or interface.

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 = "AladdinSmiley Surprisedpen 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
0 Kudos
15 Replies
squirreltown
Level 9

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

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())
Kinetics Screensavers
0 Kudos
EnTerr
Level 8

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

"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#.
0 Kudos
Tajson
Level 7

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

"Blackhawk" wrote:

 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"


You could try to change some of the above.
    theme.OverhangSliceHD = "pkg:/images/Overhang_Slice_HD.png"
    theme.OverhangPrimaryLogoSD = "pkg:/images/Logo_Overhang_SD43.png"
    theme.OverhangPrimaryLogoOffsetSD_X = "72"
    theme.OverhangPrimaryLogoOffsetSD_Y = "25"
    theme.OverhangPrimaryLogoHD = "pkg:/images/Logo_Overhang_HD.png"
    theme.OverhangPrimaryLogoOffsetHD_X = "123"
    theme.OverhangPrimaryLogoOffsetHD_Y = "48"

https://sdkdocs.roku.com/display/sdkdoc/roAppManager
0 Kudos
Tajson
Level 7

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

"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. Smiley Happy
0 Kudos
squirreltown
Level 9

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

"Tajson" wrote:
"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. Smiley Happy

I think if you are taking the time to answer, you shouldn't have to count. It's courtesy. Smiley Happy
Kinetics Screensavers
0 Kudos
EnTerr
Level 8

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

"Tajson" wrote:
Count the actual code lines aka skip comments and white spaces then stop at 22. Smiley Happy

Oh yeah. I am totally going to do that! </sarcasm>
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
0 Kudos
belltown
Level 7

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

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.
https://github.com/belltown/
0 Kudos
Tajson
Level 7

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

"EnTerr" wrote:
"Tajson" wrote:
Count the actual code lines aka skip comments and white spaces then stop at 22. Smiley Happy

Oh yeah. I am totally going to do that! </sarcasm>
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.
0 Kudos
Blackhawk
Level 7

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

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)
0 Kudos