using javascript api to communicate with flash pano

Q&A about the latest versions
Post Reply
DCrockett
Posts: 4
Joined: Tue Jun 26, 2012 10:46 am
Contact:

I'm trying to control a flash pano using the javascript api but I keep getting 'undefined' error whenever I make a function call. I enabled the javascript api in the html panel of the flash output in Pan2VR.

Here's the code that gets generated with a button I added that calls the getPan() function:

Code: Select all

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
		<title></title>
		<script type="text/javascript" src="swfobject.js">
		</script>
...
	</head>
	<body>
		<h1></h1>
		<p>
		<script type="text/javascript">
<!--
			var flashvars = {};
			var params = {};
				// enable javascript interface
				flashvars.externalinterface="1";
			params.quality = "high";
			params.bgcolor = "#ffffff";
			params.allowscriptaccess = "sameDomain";
			params.allowfullscreen = "true";
			params.base=".";
			var attributes = {};
			attributes.id = "pano";
			attributes.name = "pano";
			attributes.align = "middle";
			swfobject.embedSWF(
				"york1.swf", "flashContent", 
				"640", "426", 
				"9.0.0", "expressInstall.swf", 
				flashvars, params, attributes);
//-->
		</script>
		<div id="flashContent">
			<p><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a></p>
		</div>
		<button onclick="a=document.pano.isComplete();alert(a);return false;">get pan</button>
	</body>
</html>

What am I doing wrong?

Don
RBrooks
Posts: 20
Joined: Wed Jul 11, 2012 10:20 am

I'm trudging through this myself, but it doesn't appear to be calling getPan(). It's calling document.pano.isComplete();alert(a);return false;

Did you ever get this to work?
Post Reply