I am trying to make a slide show of images with javascript. I don't want the page to refresh so I call document.write() every time the next and previous buttons is clicked. Onclick, I call a funcion that ajust the current frame number and call updte(currentFrame) that does document.write() and write the entire page.
When the page is first loaded is calls
CODE
updte(1);
CODE
function updte(f)
{
document.write("<body bgcolor = '#000000' style='color:#ffffff' ><div align = 'center'><img src ='logo.jpg'/> <br /> <input type = 'button' value = 'Hide Descriptions' onclick = 'off()'/><input type = 'button' name = 'backward' value = '< previous frame' onClick = 'goBack()'><input onClick = 'goForward()' type = 'button' name = 'fowards' value = ' next frame >'><br /> <br /> <br /> <table border='0' align = 'center'><tr><td width='241' height='261' rowspan='2' valign = 'Top'><b>Brief description of action:</b><br /> "+actionArr[f]+" <br /> <b>Dialogue / Voiceover:</b><br /> "+ dialogueArr[f]+"<br /><b> Setting:</b><br /> "+setArr[f]+"<br /><b><br />Shot size:</b> "+sizeArr[f]+"</td><td width='332' height='67' valign = 'Top' align = 'center'><b>Number:</b><br /><b> Time: </b>"+TimeArr[f]+"</td> <td width='252' rowspan='2' valign = 'Top'><b>Camera movement:</b><br /> "+camMoveArr[f]+" <br /><b>Camera Angle:</b><br /> "+camAngArr[f]+" <b><br />Lighting:</b><br /> "+lightArr[f]+"<b><br />Props:</b> <br />"+ propArr[f]+"<b>Costume:</b> <br />"+cosArr[f]+"<b><br />Music:</b> <br />"+musicArr[f]+" <b><br />Sound FX</b><br />" +soundArr[f]+"</td></tr><tr><td height=296 width='380' valign = 'Top'><img name = 'change' src = '" + imageArr[f]+ " ' width='330' height='271' /></td> </tr></table></div>");
}
CODE
function goBack()
{
if (frame == 1 )
{frame = numFrames}
else frame--;
updte(frame);
}
function goForward()
{ if (frame == numFrames )
{frame = 1}
else {frame++}
updte(frame);
}
{
if (frame == 1 )
{frame = numFrames}
else frame--;
updte(frame);
}
function goForward()
{ if (frame == numFrames )
{frame = 1}
else {frame++}
updte(frame);
}
The problem is that I randomly get a goForward not defined error (mostly on the third or second click, but never on the first.)
Please Help!
