You are not logged in.

Dear visitor, welcome to krpano.com Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Thursday, October 20th 2011, 11:12am

How to perform Event "onsceneloaded" ?!?

Hi there,

is there such thing as "onsceneloaded"? I know there are onload-, onpreview-, onnew-, onxmlcomplete-events, but how do I tell krpano to perform an action every time a scene is fully loaded? The onloadedcomplete-event loads the full SWF-File before performing the action, which is quite ineffective if the SWF is about 10-20mb.

I need to perform an action after the first scene is fully loaded to remove the initial black-screen and progress bar.

Thanks and best regards
Nupsi

2

Thursday, October 20th 2011, 11:30am

i hope this old thread could help

Perform action every time a scene is loaded completely

3

Thursday, October 20th 2011, 1:19pm

Nope, that´s no help, mjdevil, because that topic is about the onloadcomplete-event, which loads the full SWF before it triggers the action. But thanks anyway *smile*

Best regards
Nupsi

4

Thursday, October 20th 2011, 1:54pm

Hi,
onloadcomplete-event, which loads the full SWF before it triggers the action.
this is NOT correct!
the onloadcomplete event will be called when the pano image was loaded completely,

to your question either use the global onloadcomplete event or use a local/named onloadcomplete event inside the scene,
e.g.

Source code

1
2
3
4
<scene ...>
   <events name="scene" onloadcomplete="..." />
   ...
</scene>


best regards,
Klaus

5

Thursday, October 20th 2011, 3:03pm

Hi,
onloadcomplete-event, which loads the full SWF before it triggers the action.
this is NOT correct!

oops...my failure. I thought it would be that way because even if I use a single image for the panorama the loading bar keeps showing the loading progress after the pano is loaded?! I'll try the event inside a scene.

Thanks!
Nupsi

6

Sunday, October 23rd 2011, 11:35am

......use a local/named onloadcomplete event inside the scene,
e.g.

Source code

1
2
3
4
<scene ...>
   <events name="scene" onloadcomplete="..." />
   ...
</scene>


best regards,
Klaus
I did try the named onloadcomplete-event inside the scene and it worked just fine! Thanks again, Klaus *thumbsup*

Best regards,
Nupsi

7

Saturday, October 29th 2011, 5:07pm

Hey again, Klaus ;-)

After a feeeew tests it seems that the onloadcomplete-tag really loads the whole SWF-File before it triggers the event. I´ve got a few tours which sizes from 3 to 10 MB and every tour is buld the same way with the same loading-order inside the SWF-File:

tour.xml <<--main xml with scenes etc.
audio.xml <<--just a few standard sound-actions
soundinterface.swf
preview01.jpg <<--lowres-version of the first pano (about 10KB)
pano01.jpg <<--flat highres-version of the first pano (about 1MB)

and then comes the rest like interface-graphics, one or two SWF-animations etc.

And krpano always loads the full SWF before the first pano starts, which I checked with a monitoring-software.
Here´s the basic code I use to start the tour.....

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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<krpano version="1.0.8" onstart="">

<include url="audio.xml" keep="true" />

<display details="22"
	       tessmode="auto"
	       movequality="HIGH"
	       stillquality="HIGH"
	       flash10="on"
	       movequality10="HIGH"
	       stillquality10="BEST"
		stilltime="0.1"
		/>

<!-- Auto-Rotation -->
	<autorotate enabled="true"
				waittime="3.0"
				speed="3.0"
				tofov="80"
				/>

<!-- Loading Info -->
<progress showwait="loopings(0xFFFFFF,15,15,0,0,0x092a5e,1)"
     	          showload="bar(center,200,5,0,30,shaded,0x000000,0x092a5e,0x000000,0xffffff,1,0x000000,0)"
		  showreloads="false"
		  /> 

<!-- GLOBAL EVENTS -->		
		<!-- Fullscreen -->
			<events onenterfullscreen="action(enterfs)"
					onexitfullscreen="action(leavefs)"
					onloadcomplete="action(hide_progress)"
			/>
			
			<action name="hide_progress">
					set(progress.showwait,none);
					set(progress.showload,none);
			</action>

<!-- Load first scene-->
		<action name="startup">
			loadscene(get(scene[0].name), null, MERGE); 
		</action>

<!-- Startscene -->
		<scene name="entre_once" title="00" onstart="action(hide_mainbar);" >
		<events name="startscene" onloadcomplete="action(camview_entre)"/>
		<include url="interface.xml" keep="true" />
		<view hlookat="-13" vlookat="0" fov="43.5" maxpixelzoom="2.0" limitview="auto" />
		<preview url="panos/entre/preview01.jpg" />
		<image type="SPHERE" hfov="120.00" vfov="43.51">
			<sphere url="panos/entre/pano01.jpg" />
		</image>


Do you have any idea how I could manage it to start the first scene-action "action(camview_entre)" after the preview and pano is loaded, but before the rest of the SWF-File is loaded? Because right now it takes about 1 minute to start the tour with a slower connection (128kbit/s), because the whole 8mb are loaded.

Thanks and best regards
Nupsi

8

Friday, November 4th 2011, 4:42pm

Hi,
After a feeeew tests it seems that the onloadcomplete-tag really loads the whole SWF-File before it triggers the event.
the onloadcomplete event has nothing to do with the swf file loading,

it will be called when the pano image defined in the <image> element was loaded completely,

when you have embedded these images into the swf, and the images are at the end of the swf file - then yes, then it could happen at the same time as when the swf file itself was loaded completely,

or when you use plugin or hotspot images and load them with preload="true" but embedded them behind the pano image in the swf file, then the viewer also needs to wait until the swf is loaded so far to have these images, before it can continue,

so typically I would recommend when embedding files - first the xml files, then small button images, plugins and the preview images, and the finally at the end the pano images,

best regards,
Klaus

9

Sunday, November 20th 2011, 10:56am

Hi again, Klaus,

I think I´ve found the problem why krpano loads the whole SWF-file, even the loading-order is perfect! Every time I embed a SWF-File inside the tour-SWF (an animation, short flash-video etc.) krpano loads the main-SWF to the point where the embedded SWF sits inside the loading-order, no matter if the embedded SWF-Animation is used or not! At least that´s what I figured out during my last tests. I hope you understand what I mean, because that´s really tricky to explain in english, so here´s the whole thing in german for better understanding (sorry to all non-germans ;-) )

* * *

Ich glaube ich habe das Problem gefunden, warum krpano teils das komplette SWF-File lädt, auch wenn die Ladereihenfolge innerhalb von kprotect stimmt. Wenn ich in die Haupt-SWF, welche die komplette Tour enthält, ein weiteres SWF-File einbette (zB eine kleine Flash-Animation) dann lädt krpano die Haupt-SWF bis zu dem Punkt wo auch die zweite, eingebettete SWF liegt. Und erst wenn diese ebenfalls geladen ist, startet die Tour - völlig schnurz ob die kleine Flash-Animation erst ganz am Ende der Tour genutzt wird, oder auch überhaupt nicht. Zumindest lädt krpano die Tour ratz fatz sobald ich die inkludierte SWF-Animation nicht mit einbette, sondern sie einfach mit ins Verzeichnis lege.
* * *


Maybe you can take a loot at this weird behavior in a spare minute....if you ever have one *g*

Thanks and best regards
Nupsi

10

Sunday, November 20th 2011, 11:53am

Hi,

das Forum selbst ist eigentlich zweisprachig, d.h. es können Posts sowohl in Englisch als auch Deutsch gepostet werden,
beim Erstellen des Themas gibt es ein Sprachauswahl,

zu dem Problem:

Wie und wo wird diese SWF in der XML eingebunden? (preload=true?)
Und liegt diese SWF in kprotect Tool in der Liste der einzubindenden Dateien 'vorne', also vor den Panorama Bilder usw.?

Schöne Grüße,
Klaus

11

Sunday, November 20th 2011, 1:37pm

Fragen an die Community stelle ich eigentlich immer auf englisch, da so mehr krpano-User erreicht werden ;-)

Zum Problem: Ich glaube ich habe einen grundsätzlichen Denkfehler beim einbinden der XML. Wenn ich eine XML per include innerhalb einer Szene lade, wird diese wohl zuerst abgearbeitet bevor die eigentliche Szene geladen und angezeigt wird. Wenn ich die XML erst etwas später inkludiere, wird die SWF-Animation auch erst entsprechend später geladen und der Start des Rundgangs verläuft wie er soll.

Sorry für den überflüssigen Post, Klaus *sad* Manchmal braucht es wohl erst ´nen Denkanstoß um die eigenen Gedanken zu entwirren *g*

Dank und Gruß
Nupsi