Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

QTVR Autopan - onClick stop the autopanning

Status
Not open for further replies.

Nematoth

Programmer
Mar 29, 2002
48
MY
Hi there,

I have a problem with some javascript I am using to manipulate a quicktime movie. I found one script which makes the QTVR rotate automatically.. but now what I want to do is stop the autopanning when you click on the embedded object (QTVR). I thought it would be simple but cannot figure it out.. Here is my code for the embedding and autopanning of the QTVR:

Code:
<script language="JavaScript"><!--

  var bookmark = window.location.hash;
  var tilt;
  var fov;
  var i;
  if (bookmark.charAt(0) == '#') {
    var tmp = bookmark.substr(1).split(',');
    bookmark = unescape(tmp[0]);
    tilt = unescape(tmp[1]);
    fov = unescape(tmp[2]);
  }

  document.writeln('<object id="deccanVirtualTour" width=427 height=200');
  document.writeln(' classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"');
  document.writeln(' codebase="[URL unfurl="true"]http://www.apple.com/qtactivex/qtplugin.cab">');[/URL]
  document.writeln('  <param name="src" value="../merchants/deccan/deccanVT.mov">');
  document.writeln('  <param name="scale" value="tofit">');
  document.writeln('  <param name="autoplay" value="true">');
  document.writeln('  <param name="controller" value="false">');
    document.writeln('<param name="pan" value="180.00">');
  document.writeln('  <embed name="deccanVirtualTour" src="../merchants/deccan/deccanVT.mov"');
  document.writeln('   width="427" height="200" scale="tofit"');
  document.writeln('   pluginspage="[URL unfurl="true"]http://www.apple.com/quicktime"');[/URL]
  document.writeln('   autoplay="false" controller="false" bgcolor="ffffff"');
   document.writeln('pan="180.00"');
  document.writeln('   enablejavascript="true">');
  document.writeln('  </embed>');
  document.writeln('</object>');
  
  function startPan()
  {
	  var d = new Date();
	  
	  document.deccanVirtualTour.autotime = d.getTime();
	  document.deccanVirtualTour.autopan = window.setInterval('{var d = new Date();if (document.deccanVirtualTour.GetPluginStatus()=="Complete"){document.deccanVirtualTour.SetPanAngle(document.deccanVirtualTour.GetPanAngle()+(d.getTime()-document.deccanVirtualTour.autotime)/-200.33);document.deccanVirtualTour.autotime=d.getTime()}}',25); 
	  document.deccanVirtualTour.time = d.getTime();
  }
  
  function stopPan()
  {
	  document.deccanVirtualTour.autopan = false;
  } 
  
  startPan();
  document.deccanVirtualTour.onMouseDown = stopPan();

// -->
</script>

Can anyone see what I am doing wrong?

Nematoth
 
now what I want to do is stop the autopanning

if I do that.. the autopanning stops...

Well which is it? Do you want it to stop, or don't you?

Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Sorry, perhaps I wasn't clear with ym explanation.
I want it to stop when you click on the quicktime movie only..

Should be like this:

When you load the page, the quicktime movie autopans.. Then when u click on it to manually manipulate the movie it stops the autopanning movement.

Nematoth
 
As well as the above code, you also need to change this:

Code:
document.deccanVirtualTour.onMouseDown = stopPan();

to this:

Code:
document.deccanVirtualTour.onclick = stopPan;

Dan




Coedit Limited - Delivering standards compliant, accessible web solutions

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top