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.

boxx1

Beginner

  • "boxx1" started this thread

Posts: 16

Location: Estonia

  • Send private message

1

Thursday, April 29th 2010, 10:48pm

How to enable EVENTS for some scenes only?

Hi friends.

I am making a virtual tour with krpano-1.0.8-beta9.

I set an action called "hide-01" for the first scene. I need it to be performed whenever the user starts a least interaction with the scene. So I set the events like this:

Source code

1
2
3
4
5
<events 
onclick="action(hide-01)"
  onmousedown="action(hide-01);"
onmouseup="action(hide-01);"
  event.onmousewheel="action(hide-01);"  />


I wrote this within the
<scene> </scene>
tags. So I expext this events to work in the first scene only. But it works within every next scene of the tour. I tried to set keep and enable nodes for it like this:

Source code

1
2
3
4
5
6
 <events name="scene1"
enabled="false"
keep="false"
onmousedown="action(hide-01);"
onmouseup="action(hide-01);"
event.onmousewheel="action(hide-01);"  />


but it does not help.

Guys, can you help me to lock the events in the specific scenes only? Is it possible at all? Or they apply to the whole tour only?

VN2009

Professional

Posts: 1,336

Location: Duluth MN

  • Send private message

2

Friday, April 30th 2010, 2:33am

put the same event code in each scene. for the scenes you do not want it to run on use "null" and it won't run. using like this you should use the MERGE command so the event will get overwritten by whatever you have it declared for in each scene.

boxx1

Beginner

  • "boxx1" started this thread

Posts: 16

Location: Estonia

  • Send private message

3

Saturday, May 1st 2010, 10:46am

Thanks for a reply. But I cannot figure out, where should I place null and merge otherwise than hotspots?

I need the 3-rd scene to make exclusion from the events. I have a plugin that leads to the 3rd scene:

Source code

1
2
3
4
5
	<plugin name="SceneNav3"  	style="SceneNavigator" x="5"  y="210"
	crop="0|0|95|58" onovercrop="0|58|160|58" ondowncrop="0|116|160|58" 

	onclick="loadscene(scene3, null, MERGE, BLEND(1));" 
		 />


But anyway all events apply to the 3rd scene the same way as to all others.

michel

Professional

Posts: 1,153

Location: ANDORRA

Occupation: TV

  • Send private message

4

Sunday, May 2nd 2010, 10:48pm

Hi boxx1,
notes:
  • when loading a other xml file, all settings in the event tag remain unchanged unless they are defined again in the other xml. then the attributes will be overwritten with the new ones.
the same apply when loading a new scene...
So, you have to set the events inside each scene:

Source code

1
2
3
4
5
6
7
8
9
10
11
<scene name="scene1" >
	<events onclick="action(hide-01)" onmousedown="action(hide-01);" onmouseup="action(hide-01);" onmousewheel="action(hide-01);"  />
	.....
</scene>

	....

<scene name="scene3" >
	<events onclick="" onmousedown="" onmouseup="" onmousewheel=""  />
	.....
</scene>


Hope this help...

SAlut.

Similar threads