Sie sind nicht angemeldet.

1

Freitag, 3. Oktober 2014, 05:28

Brain hurts... losing plugins on page reload or direct link

Hi,

This is one I haven't come across it before.

I have a scene of an helicopter sat in it's original position in a museum.




On the top right there's a png plugin titled 'View Simulated Version' that when clicked loads an edited version of the scene, changes the plugin to show 'View Regular Version' , automatically starts playing a background sound of rotors and adds a toggle sound icon to the bottom bar for those that can take no more ;-)


Here's the next scene.




All works fine If I navigate to each of these scenes using either the thumbnails bar, arrow hotspots or a map marker. Problem is I need to send out some url links that go directly to these scenes and are something like http://www.mywebsite.com/tour/#/scene_hueysim/

If I copy and past that url into the browser address bar and hit enter then the scene loads, the sound starts but I lose those additional plugins as shown below. No 'View Regular Version' and no toggle sound at the bottom but all the other plugins are being displayed fine.




What would be preventing the pluginsfrom loading as they should do just because the page is linked to directly? The same thing happens when the same page is reloaded/ refreshed, the plugins disappear *cry*

Here's the code for the simulated scene and nothing complicated.

Any help is greatly appreciated so I can finish this tour off and make it live.

Thanks

Andrew


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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<scene name="scene_aircraft1" title="" onstart="" thumburl="panos/aircraft1.tiles/thumb.jpg" tag="info_1"   map="m1" mapx="" mapy="" heading="">

		<view hlookat="0" vlookat="0" fovtype="MFOV" fov="120" maxpixelzoom="1.0" fovmin="70" fovmax="100" limitview="auto" />

		<preview url="panos/aircraft1.tiles/preview.jpg" />


		<image type="CUBE" multires="true" tilesize="512" progressive="false">
			<level tiledimagewidth="512" tiledimageheight="512">
				<cube url="panos/aircraft1.tiles/%s/l3/%v/l3_%s_%v_%h.jpg" />
			</level>
			<level tiledimagewidth="1024" tiledimageheight="1024">
				<cube url="panos/aircraft1.tiles/%s/l2/%v/l2_%s_%v_%h.jpg" />
			</level>
			<level tiledimagewidth="2048" tiledimageheight="2048">
				<cube url="panos/aircraft1.tiles/%s/l1/%v/l1_%s_%v_%h.jpg" />
			</level>
			<mobile>
				<cube url="panos/aircraft1.tiles/m_%s.jpg" />
			</mobile>
		</image>

		<!-- place your scene hotspots here -->
		
		<!-- START CODE FOR SOUND -->

	<!-- start playing the sound -->
	<events name="currentpano"
	    	onnewpano="playsound(bgsnd, 'sounds/aircraftexterior.mp3|sounds/aircraftexterior.ogg', 0);"
	    	onremovepano="stopsound(bgsnd);"
	    	/>

	<!-- button to pause the sound -->
	 
	 
	<plugin name="snd" style="skin_base|skin_glow" crop="0|386|64|72" zorder="8" align="bottomleft" x="380" y="-9" 
	onloaded="if(ismobile,set(scale,1));"
	devices="all"
	scale="1.0"
	alpha="1.0"
	onclick="pausesoundtoggle(bgsnd); switch(crop, 0|386|64|72, 64|386|64|72);"
	    	/>

<!-- END CODE FOR SOUND -->	

<!-- BUTTON TO REVERT BACK TO REGULAR SCENE AND KEEP VIEW -->  

	<layer name="viewregular"  url="skin/view_regular.png" align="topright" keep="true" x="10" y="70" scale="1.0" 
	onclick="loadscene(scene_22, null, KEEPVIEW, BLEND(1));"/>	

	</scene>

2

Freitag, 3. Oktober 2014, 07:57

Just done some more testing and realised that both plugins display correctly if the plugin code below is added to the vtourskin.xml file. It doesn't dissapear afrer refreshing the page or direct linking.

Quellcode

1
2
3
4
5
6
7
8
9
10
11
12
<!--CODE FOR SOUND -->
<plugin name="snd" style="skin_base|skin_glow" crop="0|386|64|72" zorder="8" align="bottomleft" x="380" y="-9" 
	onloaded="if(ismobile,set(scale,1));"
	devices="all"
	scale="1.0"
	alpha="1.0"
	onclick="pausesoundtoggle(bgsnd); switch(crop, 0|386|64|72, 64|386|64|72);"
	    	/>

 <!-- BUTTON TO REVERT BACK TO REGULAR SCENE AND KEEP VIEW -->  
	<layer name="viewregular"  url="skin/view_regular.png" align="topright" keep="true" x="10" y="70" scale="1.0" 
	onclick="loadscene(scene_22, null, KEEPVIEW, BLEND(1));"/>	


If this code added directly into the scene code which is where it needs to be as it's just for those particular scene's then I lose them on direct linking or a refreshed page.

Very strange indeed *blink*

Beiträge: 1 857

Beruf: Virtual Tours - Photography - Krpano developer

  • Nachricht senden

3

Freitag, 3. Oktober 2014, 15:19

Should be easy to troubleshoot with a link to the project.
plugins needed global should be outside the scenes with keep=true

plugins scene specific should be inside their respective scene.
Perhaps you are not in the scene you think you are in.

Quellcode

1
<scene onstart="showlog(true);trace(xml.scene);" ..
KRPano Developer: Portfolio ::Gigapixel Tagging Solutions - Porfolio 2 :: Facebook :: Twitter :: reddit.com/r/VirtualTour

4

Samstag, 4. Oktober 2014, 02:21

Thanks Sacha.

Yes, I'm in the correct scenes.

PM sent with URL

Beiträge: 1 857

Beruf: Virtual Tours - Photography - Krpano developer

  • Nachricht senden

5

Samstag, 4. Oktober 2014, 08:41

PM Sent.

Some sort of swf address action. I just change keepbase to merge.
KRPano Developer: Portfolio ::Gigapixel Tagging Solutions - Porfolio 2 :: Facebook :: Twitter :: reddit.com/r/VirtualTour

6

Sonntag, 5. Oktober 2014, 04:03

Solved

Yes, Sacha spotted it *smile*

It was some code in swfaddress.xml that was buggering things up and probably the only file I didn't look in. In case anyone else gets the same issue here's the code change from sacha as there's not much support on the go for the swfaddress plugin. The damn thing was even effecting my text scroll windows with custom png backgrounds that I'd previously given up on as it was just displaying black when the png should be. All works now but it's amazing how many hours you can spend on troubleshooting.


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
(Existing Code)

<action name="activatepano">
   	 if (%1 != null,
   		 if (get(action[mainloadpano].content) !== null,
   			 if (%2 == xml, mainloadpano(%SWFPATH%/%1), mainloadpano(%1)),
   				 if (%2 == xml, loadpano(%SWFPATH%/%1,null,KEEPBASE,BLEND(1)), loadscene(%1,null,KEEPBASE,BLEND(1)));
   				 wait(blend);
   		 )
   	 );
    </action>


(New Code)

    <action name="activatepano">
   	 if (%1 != null,
   		 if (get(action[mainloadpano].content) !== null,
   			 if (%2 == xml, mainloadpano(%SWFPATH%/%1), mainloadpano(%1)),
   				 if (%2 == xml, loadpano(%SWFPATH%/%1,null,MERGE,BLEND(1)), loadscene(%1,null,MERGE,BLEND(1)));
   				 wait(blend);
   		 )
   	 );
    </action>