Sie sind nicht angemeldet.

1

Donnerstag, 23. Juli 2009, 09:29

problem with defining pano and sphere together

Hi,

I want to add pano (base.xml) for some plugin, and load some sphere images dynamic , therefore, I add variable in the swfobject. source code:

Quellcode

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<html>
  <head>
	<script type="text/javascript" 
        	src="scripts/swfobject.js">
	</script>
	<script type="text/javascript"
        	src="scripts/swfkrpanomousewheel.js">
	</script>
	<script type="text/javascript">
  	if (swfobject.hasFlashPlayerVersion("6.0.0")) 
  	{
    	swfobject.embedSWF("krpano.swf", "krpano", 
                        	"640", "480", "9.0.28", 
                        	"scripts/expressInstall.swf", 
							{pano:"base.xml"}, 
							{sphere:"medias/<?=$image?>.jpg"},
                        	{allowfullscreen:true, bgcolor:"#000000"}, 
                        	{id:'krpano', name:'krpano'});
                        	
    	swfkrpanomousewheel.registerObject("krpano");
  	}
  	else
  	{
    	document.getElementById("krpano").innerHTML = 
                              	'Flash Player 9 needed';
  	}
	</script>
  </head>
  <body>
	<div id="krpano">
  	<noscript>ERROR: no Javascript</noscript>
	</div>
</body>
</html>


But when I loaded the page, the image {sphere:"medias/<?=$image?>.jpg"} is not loaded into krpano, how to load pano and sphere(not define in xml file) at same time?

2

Donnerstag, 23. Juli 2009, 11:44

Hi,

in SWFOBject 2.1 all Flash variables must in the same {} block,

e.g. instead of:

Quellcode

1
2
{pano:"base.xml"}, 
{sphere:"medias/<?=$image?>.jpg"},


this:

Quellcode

1
{pano:"base.xml", sphere:"medias/<?=$image?>.jpg"},


best regards,
Klaus

3

Freitag, 24. Juli 2009, 00:53

Thank you! That works.

another javascript full screen question.

I try to let it fullscreen when user click a button

code:

Quellcode

1
2
3
4
5
6
7
8
9
10
11
function krpano() {
		return document.getElementById('krpano');
	}
function fulls() {
	  try{
		 krpano().call("switch(fullscreen);");
		}
		catch(err) {
		alert(err);
		}
	  }


but when I click the button, it gives an error:
"Error calling method on NPObject! [plugin exception: Error in Actionscript. Use a try/catch block to find error.]."

What's the problem for this?

Ähnliche Themen