• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 219
  • Last Modified:

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.
http://dijitalrealm.com/toggleFlash.html

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

Thanks,

John
0
gabrielPennyback
Asked:
gabrielPennyback
  • 2
1 Solution
 
quincydudeCommented:
like this?
<html> 
<head> 
<script type="text/javascript"> 
function validate_email(field,alerttxt)
{
with (field)
{
apos=value.indexOf("@");
dotpos=value.lastIndexOf(".");
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> 
<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";
}
</script> 
<style> 
.textBox{width:200px; line-height:16px}
body{margin:40px; font-family: Gill Sans MT; font-size:14px;
}
</style> 
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></head> 
 
<body> 
 
<div id="div1" style="position:absolute;top:50px;left:20px;width:200px;height;200px;" onmouseover="mouseOver();" onmouseout="mouseOut();"> 
<a href="http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_24156408.html" target="_blank"> 
  <img border="2" alt="Visit W3Schools!" 
 
src="http://dijitalrealm.com/images/beach3.jpg" name="x"
 
 
/> 
  </a>
</div>
<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="http://dijitalrealm.com/flash1.swf"> 
<embed src="http://dijitalrealm.com/flash1.swf" width="200" height="200"> 
</embed> 
</object> 
</div>
 
 
 
</body> 
</html> 

Open in new window

0
 
gabrielPennybackAuthor Commented:
Fantastic!  I love it when the answer is so simple and intuitive.

Thanks, quincydude.

- John
0
 
gabrielPennybackAuthor Commented:
Great answer!
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now