PDA

View Full Version : Animation with images.


VitiminD
08-08-2005, 05:00 AM
Say I have an image on a web server that is constantly being updated by a webcam. Is there a way that I can tell Flash to be loading that image every 250ms?

The camera is updating it like 20 times a second and I would like to provide the most seamless effect of motion.

My current code, while efficient and almost gets the job done, causes the mc to go away each iteration of getImage() instead of seamlessly loading it over my existing image.


createEmptyMovieClip("imageHolder", 1);
setInterval(getImage, 500);

function getImage() {
imageHolder.loadMovie("image.jpg", this);
}


Let me know what ya think!

oldnewbie
08-08-2005, 05:34 AM
Use 2 container clips (one exactly over the other...) and always load in the top container before swapping depths on them. The more recent picture will then always load over the previous one...

frank007xp
08-08-2005, 06:26 AM
you should try this :
i=1;
while(i<=20)
createEmptyMovieClip("imageHolder",1);
setInterval(getImage, 500);

function getImage() {
imageHolder.loadMovie("http://fozzie.missionmedia.net/whfs/cam1/image00001.jpg", "_level"+i);
}

VitiminD
08-08-2005, 08:14 AM
frank: that just makes an infinite loop on my end..

newbie: that makes sense in theory, but how would it be done code wise? I have tried a few variations, but got the same flicker effect.