Hello Duane,
Thanks for the help. I got the setInterval(), clearInterval to work…but it ended up giving me fits.
For some reason, my app would start out reloading fine at every interval and then it would become erratic and then hang. I put a trace on it and found that with each interval, the trace returned value was doubling and then doubling again and so forth exponentially and then crash.
I played around with this for a while, but finally gave up after discovering that setTimeout seemed to work as well but without this issue.
My first version appended the time onto the URL to avoid caching, but it seems that it takes longer to execute then just appending a random number.
I do have a couple of questions though…
First, running my widget locally, what it the profile setting to have it run “forever” ?
And second…do you know of any way to avoid the “dead screen” in between interval refreshes?
I’m not sure how to hold the previous image until the new one is loaded.
I doubt if this is the best flash script…but it’s my first attempt.
Thanks for your help
class CamView.Main {
private var Clip:MovieClip;
function Main(mc:MovieClip) {
setTimeout(main, 4000);
clearTimeout()
var RandomNum = Math.random()*1000;
var RoundNoCache = Math.round(RandomNum);
var url = "http://user:password@url:port/cgi-bin/video2.jpg?size=2&quality=3" + " " + RoundNoCache
var ThisLoader:MovieClipLoader = new MovieClipLoader();
Clip = mc.createEmptyMovieClip("Image", mc.getNextHighestDepth());
ThisLoader.loadClip( url, "Image");
}
static function main(mc:MovieClip) {
var app = new Main(mc);
}
}