kooljay68
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2013
03:46 PM
Send value from showFeed.brs to appVideoScreen.brs
How do I send a value to a function in the appVideoScreen.brs from showFeed.brs?
I am using: m.value = item.value
but when I call the m.value in the function on the appVideoScreen.brs it says invalid ?
I am using: m.value = item.value
but when I call the m.value in the function on the appVideoScreen.brs it says invalid ?
2 REPLIES 2

RokuMarkn
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2013
04:56 PM
Re: Send value from showFeed.brs to appVideoScreen.brs
That is one way to do it and it should work. What you're saying here contradicts what you said in the other thread:
Also, although what you're doing should work, it's not very good style to use global variables to pass information around. It would be better to pass your item AA into the functions that need it as a parameter.
--Mark
when I set them in showFeed.brs
m.cost = item.cost
m.model = item.modelId
print "cost "; m.cost
print "model "; m.model
the debug shows the correct values:
cost 25
model 22
Also, although what you're doing should work, it's not very good style to use global variables to pass information around. It would be better to pass your item AA into the functions that need it as a parameter.
--Mark
kooljay68
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2013
05:05 PM
Re: Send value from showFeed.brs to appVideoScreen.brs
here is the code:
here is the debug ??
ButtonPressed
ButtonPressed
cost invalid
showHomeScreen | msg = An unexpected problem (but not server timeout or HTTP error) has been detected. | index = -3
Video request failure: -3 0
showHomeScreen | msg = | index = 0
Screen closed
Function showVideoScreen(episode As Object)
if type(episode) <> "roAssociativeArray" then
print "invalid data passed to showVideoScreen"
return -1
endif
print "cost "; m.cost
port = CreateObject("roMessagePort")
screen = CreateObject("roVideoScreen")
screen.SetMessagePort(port)
screen.Show()
screen.SetPositionNotificationPeriod(30)
screen.SetContent(episode)
screen.Show()
here is the debug ??
ButtonPressed
ButtonPressed
cost invalid
showHomeScreen | msg = An unexpected problem (but not server timeout or HTTP error) has been detected. | index = -3
Video request failure: -3 0
showHomeScreen | msg = | index = 0
Screen closed