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:
Can anyone see what I am doing wrong?
Nematoth
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