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: 
AVP777
Visitor

AddRatingButton problem

Hello, I'm trying to add a rating button to a roSpringboard screen, but it's giving me a type mismatch:

screen.AddButton(1, "Play")
'screen.AddRatingButton(2, video.StarRating, video.StarRating )
screen.AddRatingButton(2, "50", "75" )
screen.AddButton(3, "Add To Favorites")

The docs say Integer, String, String as the parameters so I'm at a loss as to what the type mismatch could be.

Any pointers would be appreciated.

Thanks.
0 Kudos
3 REPLIES 3
AVP777
Visitor

Re: AddRatingButton problem

Here's the debug just in case.

Current Function:
105: Function refreshShowDetail( screen As Object, video As Object ) As Integer
106:
107: 'Uncomment this statement to dump the details for each show
108: 'PrintAA(video)
109:
110: screen.ClearButtons()
111: screen.SetStaticRatingEnabled( False )
112:
113: print( "video rating: " + video.StarRating )
114:
115: screen.AddButton(1, "Play")
116: 'screen.AddRatingButton(2, video.StarRating, video.StarRating )
117: screen.AddRatingButton(2, "50", "75" )
118: screen.AddButton(3, "Add To Favorites")
119:
120: video.Directors = video.Director
121: screen.SetContent(video)
122: screen.Show()
123:
124: End Function
/tmp/plugin/PABAAAzjiLK5/pkg:/source/detail.brs(117): runtime error 18: Type Mismatch

117: screen.AddRatingButton(2, "50", "75" )

Backtrace:
Function refreshshowdetail(screen As Object, video As Object) As Integer
Function showdetailscreen(screen As Object, video As Object) As Integer
Function main() As Void

Local Variables:
screen &h16 bsc:roSpringboardScreen, refcnt=3
video &h16 bsc:roAssociativeArray, refcnt=4
global &h07 rotINTERFACE:ifGlobal
m &h06 bsc:roAssociativeArray, refcnt=4
0 Kudos
RokuChris
Roku Employee
Roku Employee

Re: AddRatingButton problem

The documentation is incorrect. The parameters should all be integers.
0 Kudos
AVP777
Visitor

Re: AddRatingButton problem

Thank you, that sorted it out.
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.