I want to create an animation using several images, with image 1 appearing for 2 seconds, images 2-8 appearing for 100ms each, and images 9-10 appearing for 2 second each.
(it's a simplified version of the task on this page, with gifs instead of text: Attentional Blink demo)
I found a script that's vaguely similar (attached below) on another forum, but what would be the easiest way to do this? Photoshop, powerpoint, flash, javascript?
Thanks for any advice!
<html>
<head>
<title>Fingerprint analysis</title>
<script type="text/javascript">
var DELAY = 10;
var MAX = 90;
var IMAGE_COUNT = 9;
var imageno = 1;
var changes = 9;
var printimg;
var faceimg;
var interval;
function changeimg() {
changes++;
faceimg.src = "face" + imageno + ".gif";
do {
// Pick random image between 1 and IMAGE_COUNT:
var newimageno = Math.floor(Math.random()*IMAGE_COUNT + 1);
} while (newimageno == imageno); // avoid getting the same image twice in a row.
imageno = newimageno;
if (changes == MAX) {
clearInterval(interval);
var info = document.getElementById("info");
info.innerHTML = "MATCH FOUND";
}
}
function analyze() {
printimg = document.getElementById("printimg");
faceimg = document.getElementById("faceimg");
changes = 0;
interval = setInterval(changeimg,DELAY);
}
</script>
</head>
<body>
<button id="analyze" onclick="analyze();">Start</button>
<p><img id="printimg" src="finger1.gif" /><img id="faceimg" src="face1.gif" /></p>
<h1 id="info"></h1>
</body>
</html>
Edited by dargueta, 07 May 2011 - 09:17 AM.
Please use [code][/code] tags next time.


Sign In
Create Account

Back to top









