hotspot dynamic url onclick attributes

  • Hi all ^^
    I'm making a tour, and would like to isolate the hotspot openurl links so that the client is able to change it himself,
    but I can't get it working, here's what I've done :

    As far as know it should be working but it isn't, I must've forget something :'(
    I'll take any idea or suggestion on that ^^
    Thanks in advance !

  • Hi again !
    Furthur in this example, I'm trying to copy these hotspots onclick attributes for a onhover image but miss something...
    I've searched on the forum and documentation but can solve this :'(
    Here's what i'm trying to do :

    That works perfectly but I'm blocked on the fact to copy the hotspot.onclick attribute to the hotspot_hover.onclick...
    I tried :

    Code
    copy(hospot[hotspot1].onclick, plugin[hotspot_hover].onclick());

    The syntax makes me crazy with those things, I really need to work on that *wink*
    Thank you in advance for your help.
    Best reagrds.

  • try with out the ()

    copy(hospot[hotspot1].onclick, plugin[hotspot_hover].onclick);

    the () usually means, execute this code. But in this case you want to reference to the content of the onclick.

    and this is pure personal, but I like someaction(parameter1, parameter2) better, then action(someaction, parameter1, parameter2).

  • Thanks for the reply Zephyr *wink* (This time didn't call you Nupsi ^^ ).
    In fact my problem is as you see the hotspot_hover depends on the hotspot onover, so I can't use this syntax, cause if I do all my openurl will send to the same url.
    Think i'm obliged in using a if(... and I'm not to that point already :'(

    Or can I do something like :

    Code
    if(hotspot[hotspot_hover].parent, hotspot1,
         set(plugin[hotspot_hover].onclick, get(hotspot[hotspot1].onclick ) );
     );
    if...


    But that means lots of code for nothing...

    Maybe :

    Code
    set(plugin[hotspot_hover].onclick, get(hotspto[hotspot_hover].parent, onclick ) );

    ???!!!
    Thanks in advance I'm getting sick with those *wink*
    Regards.

  • I made it work with if but I'm not happy cause very much code *sad*
    Here it is :

    As my hotspots are unique, can't use a %1 to call it...
    If someone has an idea to clean all taht would be great ^^

    Thanks again.
    Best regards.

  • btw there is a typo, its hotspot, not hospot

    copy(hotspot[hotspot1].onclick, plugin[hotspot_hover].onclick);

    Im not sure what you are trying to do.

    You have a normal hotspot, and a hover hotspot, and both have the same url? But the hover hotspot is shared with all the other hotspots? why not make onover action which copies the onclick to the hoverhotspot?

    here's the cleaned up version. instead of sending hotspot2 as %1, you can use get(name) to get the name of the caller hotspot

  • Thanks a lot for that !!!
    Ok now I understand, I was thinking that in other post when I was seeing something like hotspot[get(name)]),
    I thought that "name" was for the example !!
    That's gonna help me so much !!!!
    I'm really going to work on that cause very flexible when well controlled, as Mindlessboss templates for examples.
    I would like in the future make a virtual tour template all in javascript, in case of making a complete website using Krpano , without using flash at all.
    This might be the start of a new era with 3D websites, neither than old 2D ones ^^
    Thanks a lot again !
    Best regards.

  • Hi again again again ^^
    Just one more thing *smile*
    I get the error (ERROR: no parent "hotspot[get(name)]" found) with the get action for the line :

    Code
    set(plugin[hotspot_hover].parent, hotspot[get(name)]);

    I tried to change by doing:

    Code
    set(plugin[hotspot_hover].parent, get(name) );


    But this gives me the error :
    ERROR: no parent "hotspot1" found
    ERROR: no parent "hotspot2" found
    ...
    But in fact it's the right parent name *confused*

    Maybe a syntax error ?
    It works perfectly for the copy(plugin[hotspot_hover].onclick, hotspot[get(name)].onclick); though ^^

    Thanks again again again !!
    Regards.

  • this:

    Code
    set(plugin[hotspot_hover].parent, hotspot[get(name)]);

    Will get the hotspot object. Best way is just use the get(name)

    the other approach should work... Is hotspot1 and hotspot2 above hotspot_hover in your code? Sometimes putting parents below the child gives errors.

Participate now!

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