Hi,
every XML element with a "name" attribute will become an internal "Array",
and the number of the elements can be get via ".count"
e.g.
|
Source code
|
1
2
3
4
5
6
7
8
9
10
11
12
|
<plugin name="p1" />
<plugin name="p2" />
<hotspot name="h1" />
<hotspot name="h2" />
<usertag name="u1" />
<usertag name="u2" />
...
trace(plugin.count);
trace(hotspot.count);
trace(usertag.count);
|
one more note - to access these elements from AS3:
instead of the "name" also a numeric index can be used,
e.g.
AS3:
|
Source code
|
1
2
3
4
5
6
|
var number_of_hotspots:int = krpano.get("hotspot.count");
var i:int;
for (i=0; i<number_of_hotspots; i++)
{
var hotspot:* = krpano.get("hotspot[" + i + "]");
}
|
best regards,
Klaus