Mouse event bubbling between plugins with 'enable' and 'capture' and hotspots

  • Searching the forum regarding the correct use of the 'enable' and 'capture' properties for plugins didn't give me much, so I decided to create a new thread. I seem to be having problems with using the aforementioned properties and having mouse events bubble through to any hotspots that are underneath it.

    The documentation mentions:

    Quote

    .. when "enabled=true" and "capture=false" then the mouse events are sent to the plugin and also to all underlying objects ...

    From searching the forum Klaus mentioned that with "underlying objects" he meant hotspots and the krpano object itself. Taking this explanation I would have assumed the following works, but it doesn't seem to.

    My situation is as follows (unfortunately I cannot provide working examples):

    Plugin
    I want to have an action executed whenever someone 'onmouseover' the entire Krpano viewer. To do this I created the following plugin:

    Hotspots
    Naturally I want hotspots in the viewer as well. As such, mouse events on the 'fshover' plugin needs to bubble through to all underlying objects. I would have assumed the above settings for the 'capture' and 'enabled' properties would work, but it does not.

    Any help would be greatly appreciated! If you need more (or just a better) explanation, then let me know.

  • Just a small update for future reference, I managed to more or less solve the problem but only specifically for my case. In my situation I needed a plugin overlaying the complete viewer, but the only interactive part was positioned as a small button in the top right corner.

    Note: This is just a big workaround and does not actually solve the problem related to mouse event bubbling.

    The implemented workaround is as follows:

    plugin[fsborder] with enabled=false, capture=false
    This effectively just makes it decorative and allows all other hotspots to work just fine as if nothing else is there. The plugin itself uses the resizeEvent to calculate the dimensions and resizes the plugin accordingly. This plugin has all the Actionscript for the hover and click functionality

    plugin[fsbutton]
    The aforementioned plugin dynamically adds this plugin, so we can store a reference to the event handlers in the plugin's properties:

    Edit: The methods onRollOverEvent and such are within the same Flash plugin. Their signature require to expect no arguments, unlike conventional event handlers assigned through Actionscript itself.

    Truly love how internally it all are just variables and all plugins can reference eachother through Krpano.

    Hiding/showing the plugin using Javascript
    Finally, the Javascript applies a simple hover behaviour on the SWF element, which calls the Krpano interface and tells it to hide or show the plugin.

Participate now!

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