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.

Tourvista

Intermediate

  • "Tourvista" started this thread

Posts: 211

Location: Leicester UK

  • Send private message

1

Wednesday, April 29th 2009, 1:20pm

<krpano> tag, onstart and delayedcall

Hello,

I use the following code to hide instrucions automatically after 10 seconds. It works and I am very happy with it.

Source code

1
<krpano version="1.0.8" onstart="delayedcall(10, action(hideinstructions); );">


At the momment I have the panoramas in itscorresponging folder (room1, room2, room3, etc...)

Inside each folder I have the panorama image and a pano.xml file which contains all the parameters that may be different depending on the panorama ( hlookat, vlookat, tileimagewidth, etc...)

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<krpano version="1.0.8" onstart="delayedcall(10, action(hideinstructions); );">

<include url="../global.xml"/>

<include url="../plugins.xml"/>

	 <view hlookat="-15"
	      vlookat="0"
	      fov="60" fovmin="45" fovmax="90" 
	      fisheye="0.44" fisheyefovlink="2.40" limitfov="true" 
	      />

    <preview type="cubestrip" url="preview.jpg" details="8"
	/>

    <image type="SPHERE" multires="yes" tilesize="500">
	    <level download="all" tiledimagewidth="5500" tiledimageheight="2750">
            <sphere url="tiles_10_%0v_%0u.jpg" />
	    </level>
    </image>

</krpano> 

As you can see I include global.xml and plugins.xml. Both files contain all the parameters common in all the panoramas (display, autoritate, progress, plugins, etc..)
This way if I would like to change the display details parameters I just have to edit globals.xml once and it will affect all the panormas.

Now, the question: is there another way to call the action 'hideinstructions' apart from inside the <krpano> tag? If in the future I wouldn't like to edit all the pano.xml files if I would like to change the delayedcall from 10 to 20.

Thanks in advance.

Graydon

Professional

Posts: 614

Location: Texas

Occupation: Industrial gas turbine services.

  • Send private message

2

Thursday, April 30th 2009, 4:43am

you might be able to change this...

Source code

1
<krpano version="1.0.8" onstart="delayedcall(10, action(hideinstructions); );">


to...

Source code

1
<krpano version="1.0.8" onstart="action(hideinstructions); );">


and then in your "hideinstructions" action use the wait function... reference link below.

http://www.krpano.com/docu/actions/#wait

Then, when you want to change the wait... it's only changed once in the "hideinstructions" action.

You'll want to be sure to use the oninterrupt item as well...

http://www.krpano.com/docu/actions/#oninterrupt

... otherwise users will be stuck waiting until your hideinstructions sequence is complete, including however long you set the wait for.

Graydon

Tourvista

Intermediate

  • "Tourvista" started this thread

Posts: 211

Location: Leicester UK

  • Send private message

3

Thursday, April 30th 2009, 10:00am

That's clever!

Thanks!

Tourvista

Intermediate

  • "Tourvista" started this thread

Posts: 211

Location: Leicester UK

  • Send private message

4

Friday, May 1st 2009, 9:09pm

I just saw this post in the forum

I have tried the following but it doesn't work

Source code

1
so.addVariable("krpano.onstart","delayedcall(10, action(hideinstructions); );");


neither


Source code

1
so.addVariable("krpano.onstart"," action(hideinstructions );");


Am i in the right way?

Thanks!

Graydon

Professional

Posts: 614

Location: Texas

Occupation: Industrial gas turbine services.

  • Send private message

5

Saturday, May 2nd 2009, 3:23am

At first I thought maybe the

Source code

1
);
weren't matching up... but it looks like they are.

Then I thought... there's something screwy with IE and having to leave off the ; on the last variable... but I think that's a swfobject 2.1 issue only...

... so that only leaves me the following suggestion (which the other post seems to indicate doesn't matter)
- change

Source code

1
krpano.onstart
to just

Source code

1
onstart


Other than that... *confused*

6

Monday, May 4th 2009, 10:12am

Now, the question: is there another way to call the action 'hideinstructions' apart from inside the <krpano> tag? If in the future I wouldn't like to edit all the pano.xml files if I would like to change the delayedcall from 10 to 20.
Hi,

in the 1.0.8 beta 7 there are also some new events that could help here:

"onxmlcomplete" - will be called when a XML or a SCENE was loaded
"onloadcomplete" - will be called when the loading of the pano images was done

e.g.

Source code

1
2
3
<events onxmlcomplete="..."
        onloadcomplete="..."
        />


these events will be called in every new loaded XML until
the events itself will be redefined,

best regards,
Klaus