turning individual hotspots on and off

  • is there a way to turn on hotspot A and B but not C and D ??? I have multiple hotspots in my demo spin and would like to turn on and off the directional audio hotspot independently of the standard ones. right now I have to use

    switch(hotspot.visible);

    to turn them all on and off at the same time. I could not get individual ones to turn on by themselves.

    (could this be accomplished if I turned them hotspots into plugins and use the new ox and oy offsets? as I know i can turn individual plugins on and off)

  • <action name="directionalaudio">
    switch(hotspot[plane].visible);
    switch(hotspot[copter].visible);
    </action>


    this does not work for me. in fact if I use this code and then try to use the

    switch(hotspot.visible);

    I have been using to turn all hotspots on, the 2 I declared in the above action will not show, but the rest still do. so it is like the action does something to break them from working at all. any ideas?

  • very odd... I did this same thing...

    Code
    <action name="directionalaudio">
    switch(hotspot[b1].visible);
    switch(hotspot[b2].visible);
    </action>

    ... and it worked fine... using either the swf hotspot or a png hotspot. *confused*

    If the action name was spelled differently between the defining portion and where you called for it, you would get an error. Only other thought I have right now would be to make sure the action name isn't used twice or defined in two different areas.

    I was able to recreate the same behavior when using one action to change just two hotspots visibility and another set to change them all... but with some interesting results.

    action 1 - switch b1 and b2
    action 2 - switch all

    action 1 worked fine on it's own
    action 2 worked fine on it's own

    However, if I first clicked action 1 (hide b1 b2) and then clicked action 2 over and over (hide all / show all / hide all / show all)... b1 and b2 stayed gone, the other hotspots toggled visible back and forth...

    BUT once I clicked action 1... which brought back b1 and b2... and then toggled action 2... ALL hotspots switched back and forth.

    I don't know if that would be considered a bug... or just a limiting factor when dealing with hotspots and the switch action.

    Will have to wait for Klaus' input on this item.

  • Hi,

    changing "hotspot.visible" will toggle the visibility of the internal layer that contains all hotspots,
    the individual hotspot visible will be not changed!

    e.g.
    when "hotspot.visible" is "false" - all hotspots are hidden, independed of their visible state
    when "hotspot.visible" is "true" - the hotspot visibility depends on its visible state

    this works the same for plugin and lensflare,

    I hope I cloud clarify that
    Klaus

  • VN - were you able to get this resolved?

    my latest thought was to look at the sequence in which the different actions are called... if you have turned all of the hotspots off and then are trying to turn copter and plane back on... then the action will appear to not work based upon Klaus' information.

    You would have to set all of your hotspots visibility as false and then turn on just plane and copter when needed.

    When I look at your demo / sample that you posted in the other area... I got the impression that you did something like that... because all of the hotspots appear momentarily at the beginning... and then disappear.

    Good luck

  • I got that partially fixed. Based on what Klaus stated I decided to leave the main universal hotspot switch alone and set the copter and the plane to visible= false at start. I then made an action that makes just the copter and the plane visible which works, and I am now able to turn on just the directional audio hotspots independant of the normal hotspots.

    the issue I run into now is that I cannot do the same thing with the normal hotspots. I cannot make them go visible with the same code that works on the plane and copter. my only guess is that for some reason hotspots that do not have an image attached to them like a .png or .swf are not capable of that.

    any hotspot that i have linked to a .png or .swf I can turn on and off, the ones without do not turn on/go visible. any ideas on that or has someone else came to the same conclusion?

  • Hmm... I don't know. I was able to replicate the exact issue you have...

    I created a poly hotspot... visible
    used an action to switch the hotspot visibility to false
    click again to switch back... and it doesn't come back.

    Also - make note that if you are going to be adding sound to the poly spots... the 3DHS function doesn't work... probably because of challenges figuring out where the sound point should originate from. You'll have to use the other options and set the ath atv points for sound origination.

    Based upon previous information... I'd say that this might be a bug with the poly hotspots being switched off/on.

    Graydon

  • I am glad that someone else recieved the same diagnosis. That means I am not crazy. I knew zero XML when I was first introduced to krpano eveything i have learned has taken place in the last 6 months. because of that i always question my output as I am by no means an expierinced coder, but I am learning fast!

    when Klaus reads this he will be able to let us know if this is a bug or just not possible. for now I am just going to leave my poly-hotspots on all the time.

    Thanks for your assistance Graydon.

  • Hi,
    when "hotspot.visible" is "false" - all hotspots are hidden, independed of their visible state
    when "hotspot.visible" is "true" - the hotspot visibility depends on its visible state
    Klaus

    When I do this with hotspots that were created using addhotspot(), changing hotspot.visible has no effect whatsoever. Is that to be expected, or is it a bug?

  • Hi,

    When I do this with hotspots that were created using addhotspot(), changing hotspot.visible has no effect whatsoever. Is that to be expected, or is it a bug?

    how do you mean that?

    the "hotspot.visible" variable controls the visibility of the whole hotspot layer,
    the individual hotspot[name].visible settings will be not be affected by it,
    but when the layer itself is invisible, then also all elements inside it (the hotspots) are invisible,

    best regards,
    Klaus

  • I meant that when I do set(hotspot.visible, false) then all my hotspots remain visible. Therefore I was thinking that perhaps hotspots that are added with addhotspot() are not a member of that hotspot layer you mentioned?

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!