syntax for "onclick" event settings


  • The following doesn't work, I get "remove - unknown array item - hotspot[get(hname)]"

    set(hotspot[get(hname)].onclick, removehotspot(hotspot[get(hname)]) );

    I have tried different arrangments of "get" but it still doesn't work.

    Thanks

  • Got this resolved:

    set(hotspot[get(hname)].onclick, removehotspot(get(hname)) );

    but it seems that get(hname) is evaluated at execution time, not during the settings. When I have number of hotspots, hname is set to the last hotspot, and all remove actions remove the last hotspot, not the one I am clicking.

  • Hi,

    you could either store information at the hotspot itself and then use it in the called action,
    e.g.

    Code
    set(hotspot[get(hname)].local_hname, get(hname)); 
    set(hotspot[get(hname)].onclick, removehotspot(get(local_hname)) );

    or in your special example you could just directly use the name of the hotspot itself:
    [size=10]

    Code
    set(hotspot[get(hname)].onclick, removehotspot(get(name)) );

    Note - the attributes/actions of an plugin/layer/hotspot element are 'directly' accessible in an call from the plugin/layer/hotspot event.

    Best regards,
    Klaus

Jetzt mitmachen!

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