Hi,
yes, that's possible
but the sub objects must have a "name" attribute for identification,
and the name must begin with an alphabetic character,
then an internal array for these objects is created,
e.g.
xml:
|
Source code
|
1
2
3
4
|
<plugin keep="true" alpha="1" customattribute="1" url="plugin.swf">
<object name="n1" />
<object name="n2" />
</plugin>
|
the items of this array can be accessed with the krpano.get() function,
e.g.:
as3 - get():
|
Source code
|
1
2
3
4
5
6
7
|
var plugin_object:Object = krpano.get(plugin_path);
var cnt:int = krpano.get("plugin_path + ".object.count");
for(var i:int = 0; i < cnt; i++)
{
var object:Object = krpano.get(plugin_path + ".object[" + i + "]");
trace(object.name);
}
|
or direct via direct array access (better and faster

)
|
Source code
|
1
2
3
4
5
6
7
|
var plugin_object:Object = krpano.get(plugin_path);
var objectarray:Array = plugin_object.object.getArray();
for(var i:int = 0; i < objectarray.length; i++)
{
var object:Object = objectarray[i];
trace(object.name);
}
|
these internal arrays have these interface functions for as3:
- count - returns the number of items
- getItem(index) - returns the object at the given index
- getArray() - returns a ref to a normal AS3 "Array" which contains all objects
best regards,
Klaus