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

Object Required on MoveNext()

the js will display 3 picture with slideshow with moveprevious and movenexr
encountered 'Object Required' error on MoveNext();


<HTML>
<HEAD>
<TITLE>Slideshow Sample</TITLE>
<SCRIPT LANGUAGE="JAVASCRIPT" >
PicArray = new Array("images/01.jpg","images/02.jpg","images/03.jpg")
CurrentPic = 0
ImageCount = PicArray.length - 1
function MovePrevious()
{
if (document.images && CurrentPic > 0)
{
CurrentPic--
document.myPicture.src=PicArray[CurrentPic]
}
}
function MoveNext()
{
if (document.images && CurrentPic < ImageCount )
{
CurrentPic++
document.myPicture.src=PicArray[CurrentPic]
}

</SCRIPT>
</HEAD>
<BODY BGCOLOR="WHITE">
<CENTER>
<H1>My Slide Show</H1>
<IMG SRC="images/01.jpg" NAME="myPicture" ALT="My First Slideshow">
<BR>
<A HREF="javascript:MovePrevious();">&lt;&lt; Move Previous</A>
<A HREF="javascript:MoveNext();">Move Next &gt;&gt;</A>
</CENTER>
</BODY>
</HTML>

Open in new window

0
doramail05
Asked:
doramail05
1 Solution
 
Roman GhermanSenior Software EngineerCommented:
you are missing a closing curly bracket

function MoveNext()
{
if (document.images && CurrentPic < ImageCount )
{
CurrentPic++
document.myPicture.src=PicArray[CurrentPic]
}
}

0
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.

Join & Write a Comment

Featured Post

Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

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