Hi,
the flagfile is just a
text file you would set to "true" or "false" to force an update of your image on the devices.
you need also to have an SD sized ad and an HD sized ad, and you use SetAdURL(SDAdURL,HDAdURL).
so:
'******************************************************
'** Display the home screen and wait for events from
'** the screen. The screen will show retreiving while
'** we fetch and parse the feeds for the game posters
'******************************************************
Function showPosterScreen(screen As Object, category As Object) As Integer
if validateParam(screen, "roPosterScreen", "showPosterScreen") = false return -1
if validateParam(category, "roAssociativeArray", "showPosterScreen") = false return -1
m.curCategory = 0
m.curShow = 0
temp=getcategorylist(category)
xfer=createobject("rourltransfer")
flagfile=("http://xxxxxxxxxxxx.cloudfront.net/vodrokubanner/flag.txt")
SDURL="http://xxxxxxxxxxxx.cloudfront.net/vodrokubanner/540x60.jpg"
HDURL="http://xxxxxxxxxxxx.cloudfront.net/vodrokubanner/728x90.jpg"
xfer.seturl(flagfile)
flag=xfer.gettostring()
if flag="true" then
SDAdURL=SDURL+"?rand="+rnd(10000).tostr()
HDAdURL=HDURL+"?rand="+rnd(10000).tostr()
else if flagfile="false"
SDAdURL=SDURL
HDAdURL=HDURL
end if
if temp.count() > 1 then
screen.SetListNames(temp)
?temp.count();" categories"
else
?"only ";temp.count();" category"
end if
screen.SetContentList(getShowsForCategoryItem(category, m.curCategory))
screen.SetAdURL(SDAdURL,HDAdURL)
screen.Show()
while true
msg = wait(0, screen.GetMessagePort())
if type(msg) = "roPosterScreenEvent" then
print "showPosterScreen | msg = "; msg.GetMessage() " | index = "; msg.GetIndex()
if msg.isListFocused() then
m.curCategory = msg.GetIndex()
m.curShow = 0
screen.setcontentlist([])
screen.SetFocusedListItem(m.curShow)
screen.showmessage("Retrieving")
screen.SetContentList(getShowsForCategoryItem(category, m.curCategory))
screen.clearmessage()
print "list focused | current category = "; m.curCategory
else if msg.isListItemSelected() then
m.curShow = msg.GetIndex()
print "list item selected | current show = "; m.curShow
m.curShow = displayShowDetailScreen(category, m.curShow)
screen.SetFocusedListItem(m.curShow)
print "list item updated | new show = "; m.curShow
else if msg.isScreenClosed() then
return -1
end if
end If
end while
By the way, if when you post code to the forum, please select the code and click the Code button to format it as code.
- Joel