Creating a loading screen that will show different images at different time intervals. I have a basic counter set up that when a particular value is reached, the url is changed something like shown below:
The program steps thru each line, shows image1 but never shows imgage2. The counter reaches the correct number but the image doesn't change. What is missing?
Thanks
xcounter=0
canvas = CreateObject("roImageCanvas")
port = CreateObject("roMessagePort")
canvas.SetMessagePort(port)
while xcounter < 12
print xcounter
If xcounter <= 5 then
xcounter= xcounter + 1
sleep(1000)
myurl="pkg:/images/image1.png"
endif
If xcounter > 5 and xcounter <= 11 then
xcounter= xcounter + 1
sleep(1000)
myurl="pkg:/images/image2.png"
endif
if xcounter > 12 then
exit while
endif
canvasItems = [
{
url: myurl
TargetRect:{x:100,y:70,w:500,h:10}
},
{
Text:"LOADING STREAM. . ."
TextAttrs:{Color:"#FFCCCCCC", Font:"Medium",
HAlign:"HCenter", VAlign:"VCenter",
Direction:"LeftToRight"}
TargetRect:{x:130,y:10,w:300,h:60}
}
]
'SET OPAQUE BACKGROUND
canvas.SetLayer(0, {Color:"#FF000000", CompositionMode:"Source"})
canvas.SetRequireAllImagesToDraw(true)
canvas.SetLayer(1, canvasItems)
canvas.allowupdates(true)
canvas.Show()
end while