Click to See Complete Forum and Search --> : Making pictures change


wildwobby
06-09-2003, 03:48 PM
i want to make an animated picture using javascript whats the code?

Moderators Note
Please do not post multiple threads for the same topic.

wildwobby
06-09-2003, 03:48 PM
i want to make an animated picture using javascript whats the code?

brendandonhue
06-09-2003, 07:29 PM
JavaScript does not make animations...an animation is stored in a file such as Flash or an Animated GIF.

wildwobby
06-09-2003, 08:23 PM
no, i belive u can set time timed codes.

brendandonhue
06-09-2003, 08:56 PM
You could make it cycle thru a list of images...but thats more of a slideshow than an animation.

wildwobby
06-13-2003, 04:15 PM
ok i can do that but can i make it change realy fast?

Jona
06-13-2003, 04:30 PM
You can try this (http://jagged-rocks.bravepages.com/usrjscripts/animate.html) script I made a while ago..

Jona

wildwobby
06-14-2003, 10:31 AM
then why doesnt this work?


<script language="javascript">
<script>
var num=1
img1 = new Image ()
img1.src = "../wildwobby/michael_ad_1.GIF"
img2 = new Image ()
img2.src = "../wildwobby/micheal_ad_2.GIF"
function animate(){
num=num+1
if(num==3){num=1}
document.images[0].src=eval("img"+num+".src")
setTimeout('animate()','500');
}
setTimeout('animate()','500');
function animate2(){
num=num+1
if(num==11){num=1}
document.images[1].src=eval("img"+num+".src")
setTimeout('animate2()','500');
}
setTimeout("animate4()","10");
</script>
<img name="anim" style="position:absolute; left:300; top:240;">
</body></html><nobanner>

brendandonhue
06-14-2003, 01:04 PM
You have an extra <script> tag that should not be there.
Your image does not have the attribute SRC.
You have a setTimeOut to run animate4(), which does not exist.