Hi VN2009,
After some tries, the 2 method are correct....
|
Quellcode
|
1
2
|
set(plugin[text].html,data:data2 );
set(plugin[text].html, get(data[data2].content) );
|
I have tried your code and for me it seems correct...
So, I have a suggestion:
It seems your code is based on the
masked-radar-textfield-hotspot example from Klaus (examples that comes with the Krpano download)... In this example the text has a mask and it can be scrollable... Perhaps, when you make the call to
action(changedata) , you have already scrolled the text and then the new text data is hidden by the mask?
Also, I have noticed that, when the
html of the textfield pluging is set internally instead of referring to an external data content, then the
action(changedata) has no effect
... Perhaps Klaus would explain more here.
Following, a code to demonstrate the exposed above:
|
Quellcode
|
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
|
<krpano version="1.0.8" onstart="" >
<preview type="grid(cube,32,32,256,0x000000,0x778899,0x000000);" details="8" />
<style name="buttonstyle"
url="%SWFPATH%/plugins/textfield.swf" children="false"
width="120" height="20"
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);"
/>
<data name="data1">
<p align="center"> text from data 1 </p>
</data>
<data name="data2">
<p align="center"> text from data 2 </p>
</data>
<plugin name="text1" url="%SWFPATH%/plugins/textfield.swf"
align="top" x="10" y="50"
html="data:data1"
css="p{color:#000000; font-family:Arial; font-size:20;}"
autosize="center"
/>
<plugin name="text2" url="%SWFPATH%/plugins/textfield.swf"
align="top" x="10" y="100"
html="[p align='center'] Salut [/p]"
css="p{color:#000000; font-family:Arial; font-size:20;}"
autosize="center"
/>
<action name="changedatatext1">
switch(plugin[text1].html,data:data1,get(data[data2].content));
</action>
<action name="changedatatext2">
switch(plugin[text2].html,data:data1,get(data[data2].content));
</action>
<plugin name="button_l" keep="true" style="buttonstyle"
html="[p]switch text1[/p]"
align="top" x="-240" y="50"
onclick="action(changedatatext1)"
/>
<plugin name="button_2" keep="true" style="buttonstyle"
html="[p]switch text2[/p]"
align="top" x="-240" y="100"
onclick="action(changedatatext2)"
/>
</krpano>
|
The first plugin[text1] changes his content correctly (and the 2 methods to change the content are working too)
The second plugin[text2] does not change.
Salut.