messagetype - the type of the message:
- krpano_as3_interface.DEBUG or 0
- krpano_as3_interface.INFO or 1
- krpano_as3_interface.WARNING or 2
- krpano_as3_interface.ERROR or 3
press 'O' to open this log
enable the debugmode by calling:
trace(0xFF,"debugmode on");
or with:
<krpano debugmode="true">
- to make the log window larger
- and also to show debug messages
listener
the listener function is always called with DataEvent object as parameter
krpano_as3_interface - Events:
krpano_as3_interface.PLUGINEVENT_REGISTER
this event is called after the plugin is loaded and ready for usage
in the viewer
as paramater a DataEvent object
is passed with the name / fullpath of the plugin
this name / path can be used to get / set attributes of the plugin object or also to get
the pluin object itself, e.g.
function registerEvent(event:DataEvent):void
{
var plugin_path : String = event.data;
var plugin_object : Object = krpano.get(plugin_path);
}
krpano_as3_interface.PLUGINEVENT_RESIZE
this event is called after the plugin was resized by changing the width or height attributes
as paramater a DataEvent object
is passed with the new size as String in the format "WIDTHxHEIGHT" (the two values separted by a "x"),
e.g.:
function resizeEvent(dataevent:DataEvent):void
{
var size:String = dataevent.data;
plugin_width = parseInt(size);
plugin_height = parseInt(size.slice(size.indexOf("x")+1));
}
krpano_as3_interface.PLUGINEVENT_UPDATE
this event is called when an attribute of a plugin/hotspot was changed
as paramater a DataEvent object
is passed with the name of the changed attribute,
e.g.:
function updateEvent(dataevent:DataEvent):void
{
var updatedattriubte:String = dataevent.data;
if ( updatedattriubte == "color" )
{
newcolor = plugin_object.color;
}
}
this function registers a attribute to the plugin / object / node
and sets it default value
if the attribute was already defined in the xml, the value from the
xml is kept
NOTE - this function has one special behavior:
when the type of the defaultvalue is Boolean and the attribute
was already defined in the XML (normally as String) the type
is converted to Boolean!
this allowes normal checking for true and
false instead of Strings "true" and "false"!
createarray(arrayname:String):void
create an array as subnode or when the array already exsits it resets it to empty
this is used for dynamic subnodes, when the array is not defined in the xml
getattributes():Array
return the names of all attributes of the plugin / object / node
More information / Examples
have a look at the plugin sources included in the download package (for starting - the "tutorial" plugin sources)
the most of the sources are for the free AS3 MXMLC compiler included in the Flex SDK
it is also possible to use this sources in Flash CS3 with some little modifications