Hi Aldo,
I have no real answer... Just played around your request and noticed some things... Hope it can help in a way

...
Expanding on the matter of Kinterface_array, how do I create one from scratch in xml?
First, I had never ear about the
createarray(); action... but it seems to exist and work..
I have tried your action and I get different results depending in how it was called...
Here the code I had used to test:
|
Source code
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
|
<krpano version="1.0.8" onstart="showlog();">
<preview type="grid(cube,32,32,512,0x000000,0x111111,0x555555);" />
<events onclick="sendwallpost();" />
<!--events onclick="action2();" /-->
<action name="sendwallpost">
createarray(test);
set(test[item1], "abc");
set(test[item2], "def");
trace(test[item1]);
trace(test[item2]);
trace(test.count);
</action>
<action name="action2">
createarray(test);
trace(test.count);
set(test[item1], "abc");
set(test[item2], "def");
trace(test[item1]);
trace(test[item2]);
trace(test.count);
set(test[item1].var, "abc");
set(test[item2].var, "def");
trace(test[item1]);
trace(test[item2]);
trace(test[item1].var);
trace(test[item2].var);
trace(test.count);
</action>
<action name="action3">
trace(test.count);
set(test[item1].var, "abc");
set(test[item2].var, "def");
trace(test[item1]);
trace(test[item2]);
trace(test[item1].var);
trace(test[item2].var);
trace(test.count);
</action>
<style name="buttonstyle"
url="%SWFPATH%/plugins/textfield.swf" children="false"
width="80" height="22"
css="p{color:#000000; font-family:Arial; font-weight:bold; font-size:14; margin-left:5; margin-right:5; text-align:center; }"
backgroundcolor="0xFFFFFF" roundedge="5" shadow="1" borderwidth="0" glow="4" glowcolor="0xFFFFFF"
visible="false"
onover="tween(alpha,0.7,distance(0.3,0.2));"
onout="tween(alpha,1.0,distance(0.3,0.2));"
onloaded="set(alpha,0);set(textblur,15);set(blur,15); set(visible,true); tween(alpha,1,0.3); tween(textblur,0,0.3); tween(blur,0,0.3);"
/>
<plugin name="action1" keep="true" style="buttonstyle"
html="[p]action1[/p]"
align="top" x="-100" y="35"
onclick="sendwallpost();"
/>
<plugin name="action2" keep="true" style="buttonstyle"
html="[p]action2[/p]"
align="top" x="0" y="35"
onclick="action2();"
/>
<plugin name="action3" keep="true" style="buttonstyle"
html="[p]action3[/p]"
align="top" x="+100" y="35"
onclick="action3();"
/>
</krpano>
|
First, remember to refresh your browser after each action call.
There is 3 buttons that calls the actions.
The first one calls your action
sendwallpost() and the result is as you pointed out above...
You could call the action also clicking on the pano
(<events onclick="sendwallpost();" />)...
Then, the result is:
|
Source code
|
1
2
3
|
INFO: [object Kinterface_dynamicitem]
INFO: [object Kinterface_dynamicitem]
INFO: 2
|
I do not know why this happens but the result seems more logical...
The second button calls the action
action2(); and the result is similar to your action...
If you change the events onclick by the second one that is commented, the result seems to be also more correct...
Finaly, the third button calls the action
action3(); that seems to return a correct result... It does not use the
createarray(); action and the array is created by setting a value to a variable of that array... In my understanding it is the correct way to do...
Sorry for my rudimentary explanation

...
SAlut.