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:

    Code
    <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:

    Code
    <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?

  • 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.

  • 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:

    Code
    <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.

  • 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:

    Hope this help...

    SAlut.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!