Javascript: toggling between a jpeg and a flash movie

Is it possible to toggle between a jpeg and a flash movie with javascript? PLease take a look at this page and let me know how to do it ... if it's possible.

I suppose this could be facilitated by exporting from flash with certain settings, so I'm putting this in the flash zone as well.


John CarneyReliability Business Tools Analyst IIAsked:
Who is Participating?
quincydudeConnect With a Mentor Commented:
like this?
<script type="text/javascript"> 
function validate_email(field,alerttxt)
with (field)
if (apos<1||dotpos-apos<2) 
  {alert(alerttxt);return false;}
else {return true;}
function validate_form(thisform)
with (thisform)
if (validate_email(email,"Not a valid e-mail address!")==false)
  {email.focus();return false;}
<script type="text/javascript"> 
function mouseOver()
document.getElementById("div1").style.display = "none";
document.getElementById("div2").style.display = "block";
function mouseOut()
document.getElementById("div2").style.display = "none";
document.getElementById("div1").style.display = "block";
.textBox{width:200px; line-height:16px}
body{margin:40px; font-family: Gill Sans MT; font-size:14px;
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></head> 
<div id="div1" style="position:absolute;top:50px;left:20px;width:200px;height;200px;" onmouseover="mouseOver();" onmouseout="mouseOut();"> 
<a href="" target="_blank"> 
  <img border="2" alt="Visit W3Schools!" 
src="" name="x"
<div id="div2" style="display:none;position:absolute;top:50px;left:20px;width:200px;height;200px;" onmouseover="mouseOver();" onmouseout="mouseOut();" >
<object width="200" height="200"> 
<param name="movie" value=""> 
<embed src="" width="200" height="200"> 

Open in new window

John CarneyReliability Business Tools Analyst IIAuthor Commented:
Fantastic!  I love it when the answer is so simple and intuitive.

Thanks, quincydude.

- John
John CarneyReliability Business Tools Analyst IIAuthor Commented:
Great answer!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.