Hello all,
I got a little bit stuck in developing a plugin for hotspots as the plugin does not receive mouse events.
Here is my source code
Code
/* register event handler - called to register attributes and draw initially */
/*****************************************************************************/
private function registerEvent(event:DataEvent):void
{
// get plugin path and object and make global for this instance
// ------------------------------------------------------------
plugin_path = event.data;
plugin_object = krpano.get(plugin_path);
:
:
krpano.set(plugin_path+".enabled","true");
krpano.set(plugin_path+".capture","false");
krpano.set(plugin_path+".children","true");
krpano.set(plugin_path+".zorder",5);
// add the mlabel and draw
// -----------------------
add_mlabel();
}
/* mouse event listener */
/************************/
private function mlabelMouseClickHandler(event:MouseEvent):void
{
krpano.trace(0, "XXX: Mouse Clicked");
}
/* add the MLABEL and draw */
/***************************/
private function add_mlabel():void
{
// create display objects
// ----------------------
this_arrow = new Shape();
this.addChild(this_arrow);
:
:
this_arrow.addEventListener(MouseEvent.CLICK, mlabelMouseClickHandler);
// draw
// ----
update_mlabel(); // here the graphics is drawn
}
Display More
I already tried to register the mouse event handler for the plugin object and for the mlabel object (my plugin sprite). Also tried with other mouse event types like MOUSE_DOWN. No success.
Can anybody help me?
Thanks in advance.
Thomas