Is there a way to simulate the onclick event for a hotspot element (instead of a panorama/scene)?

  • I familiarized myself with the events element and the events.dispatch action.
    Most events appear to be global - but some events (e.g. onclick) could be interpreted to be local or specific to a certain element (e.g. hotspot) in the scene rather than just the overall scene itself.
    I know I can define actions for the "onclick" attribute of a hotspot element.
    Ideally I'd like to invoke those actions without duplicating them elsewhere.
    Is there a way to accomplish this behavior?

    I tried something like this:
    get(hotspot[hotspotname]).events.dispatch("onclick");

    Unfortunately, that didn't appear to work as I had hoped.

    Thanks,
    Chuck

  • Hi,

    calling:

    Code
    hotspot[NAME].onclick();

    would work, but only when the code inside the onclick event is not directly referencing the hotspot attributes.

    e.g. calling such will not work - there the name of the current hotspot will be referenced:

    Code
    <hotspot name="spot1" ... onclick="trace(name);" />

    but this code will work:

    Code
    <hotspot name="spot1" ... onclick="trace(hotspot[spot1].name);" />

    Best regards,
    Klaus

Jetzt mitmachen!

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