Right, so I have this code. And I can't figure out why is won't work. It's really basic stuff, but I can't find whats wrong with it. Code: <html> <head> <title>Testing scripts</title> <script type="text/javascript"> var views = 0; function swapPic(objectName, newFile) { objectName.src=newFile; } function getNextPicture() { switch(views) { case 0: {swapPic(image, adversity.jpg); views++;} break; case 1: {swapPic(image, agony.jpg); views++;} break; case 2: {swapPic(image, ambition.jpg); views++;} break; case 3: {swapPic(image, apathy.jpg); views=0;} break; default: {views=0;} break; } } </script> </head> <body> [img]achievement.jpg[/img] </body> </html> achievement, adversity, agony, ambition, and apathy.jpg are all located in the same directory as this file. The idea is for the pictures to loop through everytime you mouse over it, but something is wrong and views doesn't want to go above 0.
You mispelt onmouseover then your gonna into more problems because your files should be in quotes in the case statement.
I can't believe I didn't see that. That and the function required quotes around filenames. Got it working so thanks for the help.