Hi,
I rounded up my Interface plugin, now Im trying to create another plugin, a Google Analytics plugin. This plugin needs diffent kinds of information from the interface.
For example when a hotspot is clicked, krpano sends a event with an id to the interface. The interface does all kinds of stuff (adding a compass, changing textfields etc all based on this id) and then it changes the location.
I want to send information about, what location people go to, if fullscreen button is pressed etc to Google Analytics plugin. The tricky part is, I dont want to "embed" the GA plugin into the interface. I Just want it as a plugin node in the xml, so I can remove it without rebuilding the Swf. The most information I can derive from either stage event listeners (fullscreen for example) or by the id (what location are people going to). But other stuff happening in the interface, I need to listen to certain events.
Well as some as you guys might know, communication between 2 different swf's is not that easy. I usually make a globalevents class, dispatch all my events to it, and embed the globalevent class intoo the plugin. I find that a little bit messy for some reason. But then I thought, Hey! Krpano can dispatch events, why not use that instead of a globalevents class. And this is where Im stuck.
According to the documentation:
Quoteexample - call a as3/plugin function:
as3/plugin code: function myfunction(p1:String)
{
// ... do something ...
}krpano.set("events.myfu", myfunction);
xml code: ... onclick="events.myfu(hello from xml);" ...
But instead of creating a onclick function on a hotspot in the xml, I want a make a call to dispatch the event in the Interface from a function. And in the GA plugin I want the listener.
But this doesn't seem to work:
Interface plugin:
GA plugin:
No errors, but nothing happening either. The Event doesn't get triggered in GA. Any ideas? As before, I like to skip xml actions and let flash handle the most part so the xml only has hotspots in it.