tags:

views:

149

answers:

1

I tried to switch between 2 virtual tour images and each time when I switch, it will move to a position I want. But When I call moveTo() following newPanoFromList(), it will do the startAutoPan(), and not move to the position I want.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>PTViewer</title>
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=iso-8859-1" />

<SCRIPT language="javascript">
function moveToZero() {
document.ptviewer.newPanoFromList(0);
document.ptviewer.moveTo(143,0,53,200);
}
function moveToOne() {
document.ptviewer.newPanoFromList(1);
document.ptviewer.moveTo(-131,0,42,200);
}
</SCRIPT>


</head>
<body>

<APPLET name="ptviewer" archive=ptviewer.jar code=ptviewer.class width=640 height=480 mayscript=true>

<PARAM name=pano0   value="{file=virtual2.jpg}">
<PARAM name=pano1   value="{file=virtual3.jpg}">
<PARAM name=file   value="ptviewer:0">

</APPLET>

<input type="button" value="pano0" onclick="moveToZero()" />
<input type="button" value="pano1" onclick="moveToOne()" />


</body>
</html>
A: 

Try adding stopAutoPan():

<SCRIPT language="javascript">
function moveToZero() {
  document.ptviewer.newPanoFromList(0);
  document.ptviewer.moveTo(143,0,53,200);
}
function moveToOne() {
  document.ptviewer.newPanoFromList(1);
  document.ptviewer.stopAutoPan();
  document.ptviewer.moveTo(-131,0,42,200);
}
</SCRIPT>
AlberT