You are not logged in.

  • "sachagriffin" started this thread

Posts: 1,857

Occupation: Virtual Tours - Photography - Krpano developer

  • Send private message

1

Sunday, January 8th 2012, 5:50pm

BUG: Something kills evaluation of 0 in JS

Everything is normal until I load a new xml.
Before I load the xml I try to wipe the environment
For one action I'm checking the x of a plugin but it's NaN
ok. I set my x to a known value 77,
then I check it again

krpano.call("if(plugin[scene1129].x GE 0,trace(hi)))");
krpano.call("if(plugin[scene1129].x LE 0,trace(hi)))");

Neither work even though x is 77.
And this affects ALL evaluations against 0, not just this plugin.
So common functions of previous scene where it uses GE 0 are now broken.

also using 0 no longer works.. set(i,0);
Using 1 instead, and everything is normal. For the initial xml load things are normal
KRPano Developer: Portfolio ::Gigapixel Tagging Solutions - Porfolio 2 :: Facebook :: Twitter :: reddit.com/r/VirtualTour

This post has been edited 2 times, last edit by "sachagriffin" (Jan 8th 2012, 7:33pm)


  • "sachagriffin" started this thread

Posts: 1,857

Occupation: Virtual Tours - Photography - Krpano developer

  • Send private message

2

Tuesday, January 10th 2012, 6:36pm

I tracked this down to the use of vars in loadpano or loadscene
HTML5 ONLY problem

loadscene(get(scene[0].name),null,MERGE);
works
loadscene(get(scene[0].name),wtf=whoknows,MERGE);

suddenly breaks the use of 0

krpano.call("if(plugin[hide].x GE 0,trace(hi)))");

xml used...

Source code

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
<?xml version="1.0" encoding="UTF-8"?>
<krpano	onstart="startup();" >
<plugin name="hide"    zorder="4" align="rightbottom" x="40"  y="+37"	edge="left"			url="%SWFPATH%/skin/seeit360_blue_v3.png" crop="340|0|34|34"	ondowncrop="340|34|34|34" ondown="hidegraphics();set(plugin[unhide].visible,true);" 			tag="nav"	visible="true"	keep="true" layout="large" />
<action name="startup">
trace('v18');
loadscene(get(scene[0].name),null,MERGE); 
</action>
<scene name="scene1129"	>
<view hlookat="" vlookat="" maxpixelzoom="1.0" fov="100" fovmin="50.0" fovmax="120.0" />
	<preview url="http://www.seeit360.com/files2/krpanotiles/boquete1.tiles/preview.jpg" />

		<image type="CUBE" multires="true" tilesize="512" progressive="false" >
			<level tiledimagewidth="3183" tiledimageheight="3183" >
				<cube  url=".../l3_%s_%0v%0h.jpg" />
			</level>
			<level tiledimagewidth="1592" tiledimageheight="1592" >
				<cube  url=".../l2_%s_%0v%0h.jpg" />
			</level>
			<level tiledimagewidth="796" tiledimageheight="796" >
				<cube  url="...s/l1_%s_%0v%0h.jpg" />
			</level>
		<mobile>
			<cube url=".../mobile_%s.jpg" />
		</mobile>
		<tablet>
			<cube url=".../tablet_%s.jpg" />
		</tablet>
	</image>
</scene>
</krpano>


embed code

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
<script type="text/javascript">
<!--//--><![CDATA[//><!--

var viewer = createPanoViewer({swf:"/seeit360/tour1122.swf", target:"pano"});
var ua = navigator.userAgent.toLowerCase();
viewer.addVariable("startscene", "scene1129");
viewer.addVariable("tour_link", document.URL);
if(ua.indexOf("ipad") >= 0 || ua.indexOf("iphone") >= 0 ||  ua.indexOf("ipod") >= 0) {
	viewer.addVariable("xml", "/xml");
	viewer.addVariable("ampersand", "&");
	viewer.embed();
	var krpano = document.getElementById("krpanoSWFObject");
//--><!]]>
</script>
KRPano Developer: Portfolio ::Gigapixel Tagging Solutions - Porfolio 2 :: Facebook :: Twitter :: reddit.com/r/VirtualTour

3

Thursday, January 12th 2012, 4:45pm

Hi,

just note - this bug will be fixed in the next release,

best regards,
Klaus