Forum Moderators: open
I originally had my site setup to use a slide show gif file, and i made sure to explain to the client that the images would not look right in the file and they said they didnt care....now they care.
Ive changed all my slide shows over to a SWF format, and they all work, now im having trouble with the clicked image replacing my new flash file.
Here goes:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script src="AC_RunActiveContent.js" language="JavaScript" type="text/javascript"></script>
<script src="AC_Flash.js" language="JavaScript" type="text/javascript"></script>
<script>
var browserType;
if (document.layers) {browserType = "nn4"}
if (document.all) {browserType = "ie"}
if (window.navigator.userAgent.toLowerCase().match("gecko")) {browserType= "gecko"}
function hide0() {
if (browserType == "gecko" )
document.poppedLayer = eval('document.getElementById(\'shift\')');
else if (browserType == "ie")
document.poppedLayer = eval('document.all[\'shift\']');
else
document.poppedLayer = eval('document.layers[\'`shift\']');
document.poppedLayer.style.visibility = "hidden";
}
function show0() {
if (browserType == "gecko" )
document.poppedLayer = eval('document.getElementById(\'shift\')');
else if (browserType == "ie")
document.poppedLayer = eval('document.all[\'shift\']');
else
document.poppedLayer = eval('document.layers[\'`shift\']');
document.poppedLayer.style.visibility = "visible";
}
function hide1() {
if (browserType == "gecko" )
document.poppedLayer = eval('document.getElementById(\'flash\')');
else if (browserType == "ie")
document.poppedLayer = eval('document.all[\'flash\']');
else
document.poppedLayer = eval('document.layers[\'`flash\']');
document.poppedLayer.style.visibility = "hidden";
}
function show1() {
if (browserType == "gecko" )
document.poppedLayer = eval('document.getElementById(\'flash\')');
else if (browserType == "ie")
document.poppedLayer = eval('document.all[\'flash\']');
else
document.poppedLayer = eval('document.layers[\'`flash\']');
document.poppedLayer.style.visibility = "visible";
}
function doTimer() {
var timeout
timeout = setTimeout("show1();hide0();", 30000);
}
function changePic(newContent) {
document.images['main'].src = newContent;
show0()
hide1()
window.cleartimout(timeout)
doTimer()
}
</script>
</head>
<body>
<div style="position:absolute;top:0px;left:0px;z-index:1;visibility:hidden;" id="shift"> <img src="shift2.gif" width="300" height="220" name="main"> </div>
<div style="position:absolute;top:0px;left:0px;visibility:visible;" id="flash">
<noscript>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="300" height="220">
<param name="movie" value="shift.swf">
<param name="quality" value="high">
<embed src="shift.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="300" height="220"></embed></object>
</noscript>
<script language="JavaScript" type="text/javascript" >
<!--
AC_RunFlContentX ("movie", "shift" , "quality", "high" , "bgcolor", "#FFFFFF" , "src", "shift" , "width", "300" , "height", "220" , "name" , "shift", "id", "shift");
//-->
</script>
</div>
</body>
</html>
that is what my code base currently looks like. The JS for the flash file is there so that pesky windows update doesnt bother my interactivity.
This is completely new territory for me. How can i make that image appear overtop of the flash animation escentially hiding it? After that, i want the image to go back to being invisible and then flash animation visible again.
Oh, the initial execution comes from a differnt file, so this is what that looks like:
[code]
<a href="#"><img name="exterior_r5_c2" src="pics/thumbs/exterior3.gif" width="73" height="73" border="0" alt="" onClick="parent.hotspot.changePic('pics/exterior3.jpg');features('about:blank')"></a>
[code]
and yes, the frame holding the called function is named hotspot.
(after i posted this i went and wrote it myself....word of advice the D in getElementById.....that should be lower-case my friends)
Heres the code if anyone is curious as to what i came up with:
var timeout
function show0(){
document.getElementById('shift').style.visibility = 'visible';
}
function hide0(){
document.getElementById('shift').style.visibility = 'hidden';
}
function show1(){
document.getElementById('flash').style.visibility = 'visible';
}
function hide1(){
document.getElementById('flash').style.visibility = 'hidden';
}
function doTimer() {
timeout = setTimeout("show1();hide0();", 30000);
}function changePic(newContent) {
document.images['main'].src = newContent;
show0()
hide1()
window.clearTimeout(timeout)
doTimer()
}