You are not logged in.

Dear visitor, welcome to krpano.com Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Saturday, November 28th 2009, 11:30pm

use radar + textfield plugin together

Hello,

I hope I'm on the right subforum right now. I have a question about using the radar and texfield plugin together. I have 2 pano's now and they are linked by a hotspot and a radar. I also have two textfield-hotspots (polygonal). I have 3 xml-files, for the 2 pano's and a 'general' one. The xml for the polygonal textfield-hotspots is in the pano1.xml-file. When I open pano1.html, the textfields work. When I open the general html (xml)-file, the textfields don't pop-up. I can see the polygonal hotspots, but when clicking on them, nothing happens.

The next thing is: how do I close the first textfield when the second shows up? I tried
set(plugin[htmltext2].enabled,true);
set(plugin[htmltext].enabled,false);
but that doesn't work well. I also like to close an active textfield when going to another pano (by clicking on a hotspot).

And another question: I want to make a pano with 10 textfield-hotspots (or maybe more or less ;)). Is it possible to make one action to close the active window? I don't like to have action hidewindow, hidewindow2, hidewindow3 ... hidewindow10. And the same for the actions to show the textfield. I want to have the same way of popping up, but with another text.

I hope someone can help me out. I'm sorry they're all beginners questions :(.

I can't post the xml because it's too many characters ;).

2

Saturday, November 28th 2009, 11:31pm

xml:
general xml file:

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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
<krpano version="1.0.8" onstart="action(load1);">

<view hlookat="0" vlookat="0" fov="90" />

<!-- events - fullscreen button change, set cursor on start -->
<events onxmlcomplete="action(qtvrcursor);"
onenterfullscreen="set(plugin[openfs].visible,false); set(plugin[closefs].visible,true);"
onexitfullscreen ="set(plugin[openfs].visible,true);  set(plugin[closefs].visible,false);"
/> 
 
 <!-- actions to change the mouse cursor -->
<action name="dragcursor">
set(plugin[dragmode].visible, false);
set(plugin[movemode].visible, true);
set(control.mousetype, drag2D);
set(cursors.url, %SWFPATH%/skin/drag-cursors.png);
set(cursors.type, drag);
set(cursors.move,  2|0|30|32);
set(cursors.drag, 37|0|30|32);
</action>

<action name="qtvrcursor">
set(plugin[dragmode].visible, true);
set(plugin[movemode].visible, false);
set(control.mousetype, moveto);
set(cursors.url, %SWFPATH%/skin/qtvr-cursors.png);
set(cursors.type, 8way);
set(cursors.move,   0|0|16|16);
set(cursors.drag,  16|0|16|16);
set(cursors.arrow_u,   32|0|16|16);
set(cursors.arrow_d,   48|0|16|16);
set(cursors.arrow_l,   64|0|16|16);
set(cursors.arrow_r,   80|0|16|16);
set(cursors.arrow_lu,  96|0|16|16);
set(cursors.arrow_ru, 112|0|16|16);
set(cursors.arrow_rd, 128|0|16|16);
set(cursors.arrow_ld, 144|0|16|16);
</action>

         <!-- some default buttons (zooming, direction, hotspots on/off, fullscreen) -->
<plugin name="in" align="bottom" x="-160" y="10" url="%SWFPATH%/skin/buttons.jpg" crop="160|0|40|40" onovercrop="160|40|40|40" ondowncrop="160|80|40|40" blendmode="screen" ondown="set(movevectorz,-1);" onup="set(movevectorz,0);" />
<plugin name="out" align="bottom" x="-120" y="10" url="%SWFPATH%/skin/buttons.jpg" crop="200|0|40|40" onovercrop="200|40|40|40" ondowncrop="200|80|40|40" blendmode="screen" ondown="set(movevectorz,+1);" onup="set(movevectorz,0);" />
<plugin name="left" align="bottom" x="-80" y="10" url="%SWFPATH%/skin/buttons.jpg" crop= "0|0|40|40" onovercrop= "0|40|40|40" ondowncrop= "0|80|40|40" blendmode="screen" ondown="set(movevectorx,-1);" onup="set(movevectorx,0);" />
<plugin name="right" align="bottom" x="-40" y="10" url="%SWFPATH%/skin/buttons.jpg" crop= "40|0|40|40" onovercrop= "40|40|40|40" ondowncrop= "40|80|40|40" blendmode="screen" ondown="set(movevectorx,+1);" onup="set(movevectorx,0);" />
<plugin name="up" align="bottom" x="+0" y="10" url="%SWFPATH%/skin/buttons.jpg" crop= "80|0|40|40" onovercrop= "80|40|40|40" ondowncrop= "80|80|40|40" blendmode="screen" ondown="set(movevectory,-1);" onup="set(movevectory,0);" />
<plugin name="down" align="bottom" x="+40" y="10" url="%SWFPATH%/skin/buttons.jpg" crop="120|0|40|40" onovercrop="120|40|40|40" ondowncrop="120|80|40|40" blendmode="screen" ondown="set(movevectory,+1);" onup="set(movevectory,0);" />
<plugin name="hotspots" align="bottom" x="+80" y="10" url="%SWFPATH%/skin/buttons.jpg" crop="240|0|40|40" onovercrop="240|40|40|40" ondowncrop="240|80|40|40" blendmode="screen" onhover="showtext(Toggle Hotspots, buttonstyle);" onclick="switch(hotspot.visible);" />
<plugin name="dragmode" align="bottom" x="+120" y="10" url="%SWFPATH%/skin/buttons.jpg" crop="400|0|40|40" onovercrop="400|40|40|40" ondowncrop="400|80|40|40" blendmode="screen" onhover="showtext(Change Controlmode, buttonstyle);" onclick="action(dragcursor);" visible="true" />
<plugin name="movemode" align="bottom" x="+120" y="10" url="%SWFPATH%/skin/buttons.jpg" crop="360|0|40|40" onovercrop="360|40|40|40" ondowncrop="360|80|40|40" blendmode="screen" onhover="showtext(Change Controlmode, buttonstyle);" onclick="action(qtvrcursor);" visible="false" />
<plugin name="openfs" align="bottom" x="+160" y="10" url="%SWFPATH%/skin/buttons.jpg" crop="280|0|40|40" onovercrop="280|40|40|40" ondowncrop="280|80|40|40" blendmode="screen" onhover="showtext(Fullscreen, buttonstyle);" onclick="set(fullscreen,true);" visible="true" />
<plugin name="closefs" align="bottom" x="+160" y="10" url="%SWFPATH%/skin/buttons.jpg" crop="320|0|40|40" onovercrop="320|40|40|40" ondowncrop="320|80|40|40" blendmode="screen" onhover="showtext(Exit Fullscreen,buttonstyle);" onclick="set(fullscreen,false);" visible="false" />

 <!-- change the default textstyle for showtext: -->
 <textstyle name="DEFAULT" font="Arial" fontsize="14" border="false" background="false" textcolor="0xFFFFFF" effect="glow(0x000000,0.7,4,2);dropshadow(4,45,0x000000,4,1);"/>

<textstyle name="smalltext" font="Arial" fontsize="10" border="false" background="false" textcolor="0xFFFFFF" effect="glow(0x000000,0.7,4,2);dropshadow(2,45,0x000000,3,1);"/> 

<plugin name="map" url="plattegrond.jpg" zorder="1" origin="righttop" edge="righttop" x="16" y="16" alpha="0.85" handcursor="false" width="200" height="200" onhover="showtext(kaart sluiten,smalltext);" onclick="action(closemap);"/>

 <plugin name="spot1" url="mappoint.png" zorder="2" origin="righttop" edge="center" x="120" y="65" onhover="showtext(valkenburg1);" onclick="action(load1);"/>
 <plugin name="spot2" url="mappoint.png" zorder="2" origin="righttop" edge="center" x="100" y="100" onhover="showtext(valkenburg2);" onclick="action(load2);"/>
 
<!-- first hotspot -->
<plugin name="spotx" url="mappointactive.png" zorder="4" origin="righttop" edge="center" x="120" y="65"/>

<!-- radar plugin, set heading with "plugin[radar].heading" -->
 <plugin name="radar" url="../plugins/radar.swf" zorder="3" origin="righttop" edge="center" x="120" y="65" width="120" height="120"/>

<!-- actions -->

<action name="startloading">
push(view.fovmin);
set(view.fovmin,1);
</action>

<action name="loadingdone">
pop(view.fovmin);
</action>

<action name="lookinterrupt">
action(loadingdone);
breakall();
</action>

  <action name="load1">
set(plugin[spotx].x,120);
set(plugin[spotx].y,65);
set(plugin[radar].x,120);
set(plugin[radar].y,65);
loadpano(valkenburg1.xml,null,KEEPALL,BLEND(2));
set(plugin[radar].heading,230);
</action>

<action name="load2">
set(plugin[spotx].x,100);
set(plugin[spotx].y,100);
set(plugin[radar].x,100);
set(plugin[radar].y,100);
loadpano(valkenburg2.xml,null,KEEPALL,BLEND(2));
set(plugin[radar].heading,240);
</action>

  <action name="showspots">
  set(plugin[spot1].alpha,0);
set(plugin[spot2].alpha,0);
set(plugin[spotx].alpha,0);
set(plugin[radar].alpha,0);
  
set(plugin[spot1].visible,true);
set(plugin[spot2].visible,true);
set(plugin[spotx].visible,true);
set(plugin[radar].visible,true);

tween(plugin[spot1].alpha,1);
tween(plugin[spot2].alpha,1);
tween(plugin[spotx].alpha,1);
tween(plugin[radar].alpha,1);
</action>

<action name="hidespots">
set(plugin[spot1].visible,false);
set(plugin[spot2].visible,false);
set(plugin[spotx].visible,false);
set(plugin[radar].visible,false);
</action>

<action name="closemap">
    action(hidespots);
    set(plugin[map].onhover,showtext(kaart openen,smalltext););
    set(plugin[map].onclick,action(openmap););
    tween(plugin[map].width,32,distance(200,0.5),easeoutquad);
    tween(plugin[map].height,32,distance(200,0.5),easeoutquad);
</action>

<action name="openmap">
set(plugin[map].onhover,showtext(kaart sluiten,smalltext););
    set(plugin[map].onclick,action(closemap););
    tween(plugin[map].width,200,distance(200,0.5),easeoutquad);
    tween(plugin[map].height,200,distance(200,0.5),easeoutquad,action(showspots););
</action>

</krpano>

3

Saturday, November 28th 2009, 11:35pm

pano1.xml (it's actually valkenburg1.xml ;)):

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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
<krpano version="1.0.8">

<!-- set initial view -->
<view hlookat="0" vlookat="0" fov="90" maxpixelzoom="1.00" fovmax="150" />

<!-- the preview and pano image -->        
<preview type="SPHERE" url="valkenburg1.tiles/preview.jpg" />

<image type="SPHERE" multires="true" tilesize="554">
<level tiledimagewidth="20526" tiledimageheight="3662">
<sphere url="valkenburg1.tiles/l3_%0v_%0h.jpg" />
</level>

<level tiledimagewidth="10263" tiledimageheight="1831">
<sphere url="valkenburg1.tiles/l2_%0v_%0h.jpg" />
</level>

<level tiledimagewidth="5132" tiledimageheight="916">
<sphere url="valkenburg1.tiles/l1_%0v_%0h.jpg" />
</level>

</image>

<!-- hotspots -->
<hotspot name="pano2" url="pano2.png" ath="197.45" atv="-6.8" scale="0.4" zoom="true"
alpha="0.6"
onover="tween(alpha,1);tween(scale,0.7);"
onout="tween(alpha,0.7);tween(scale,0.4);"
onclick="looktohotspot(pano2); action(load2); lookto(0,0,150);"
/>

<hotspot name="jaap"
keep="false"
visible="true" enabled="true" handcursor="true" capture="true" children="true"
zorder="0"
fillcolor ="0xffffff" fillalpha ="0.00" borderwidth ="2.0" bordercolor ="0xffffff" borderalpha ="0.50"
fillcolorhover="0xffffff" fillalphahover="0.20" borderwidthhover="4.0" bordercolorhover="0xffffff" borderalphahover="0.80"
   fadeintime="0.150" fadeouttime="0.300" fadeincurve="1.100" fadeoutcurve="0.700"
onover=""
onhover="showtext(jaap);"
onout=""
ondown=""
onup=""
   onclick="action(show_jaap);"
>
<point ath="-156.2902" atv=" -3.0426" />
<point ath="-155.8229" atv=" -2.7695" />
<point ath="-155.2742" atv=" -2.3191" />
<point ath="-154.9528" atv=" -1.9167" />
</hotspot>

<hotspot name="hanneke"
     keep="false"
     visible="true" enabled="true" handcursor="true" capture="true" children="true"
      zorder="0"
     fillcolor ="0xffffff" fillalpha ="0.00" borderwidth ="2.0" bordercolor ="0xffffff" borderalpha ="0.50"
 fillcolorhover="0xffffff" fillalphahover="0.20" borderwidthhover="4.0" bordercolorhover="0xffffff" borderalphahover="0.80"
     fadeintime="0.150" fadeouttime="0.300" fadeincurve="1.100" fadeoutcurve="0.700"
     onover=""
     onhover="showtext(hanneke);"
     onout=""
     ondown=""
     onup=""
     onclick="action(show_hanneke);"
     flying="0"
>
<point ath="-164.1424" atv="  0.8945" />
<point ath="-163.9564" atv="  0.3221" />
<point ath="-163.8992" atv=" -0.0215" />
<point ath="-163.5129" atv=" -0.4224" />
</hotspot>

 <data name="htmldata">
<p>
<font face="Verdana, Arial, Helvetica, sans-serif" size="+4">
bla
<a href="event:action(hidewindow,htmltext);">Sluiten</a>
</p>
</data>

<data name="htmldata2">
bla
<a href="event:action(hidewindow2,htmltext2);">Sluiten</a>
</data>

 <data name="cssdata">
a{ text-decoration:underline; font-weight:bold; }
a:hover{ color:#885500; }
</data>

<action name="show_jaap">
set(plugin[htmltext].y,-1500);
tween(plugin[button].alpha,0,,,set(plugin[button].visible,false));
tween(plugin[htmltext].alpha,1,0);
tween(plugin[htmltext].textblur,0,0);
tween(plugin[htmltext].blur,0,0);
set(plugin[htmltext].visible,true);
set(plugin[htmltext].enabled,true);
tween(plugin[htmltext].y,0);
</action>

<action name="show_hanneke">
set(plugin[htmltext2].enabled,true);
tween(plugin[htmltext2].blur,8,0);
tween(plugin[htmltext2].textblur,8,0);
set(plugin[htmltext2].blur,8);
set(plugin[htmltext2].textblur,8);
set(plugin[htmltext2].visible,true);
tween(plugin[htmltext2].blur,0);
tween(plugin[htmltext2].textblur,0);
tween(plugin[htmltext2].alpha,0.8);
</action> 
 
<action name="hidewindow">
set(plugin[%1].enabled,false);
tween(plugin[%1].alpha,0);
tween(plugin[%1].blur,20);
tween(plugin[%1].textblur,20,,,set(plugin[%1].visible,false));
</action>

<action name="hidewindow2">
set(enabled,false);
tween(alpha,0);
tween(blur,20);
tween(textblur,20,,,set(visible,false));
</action>

 <plugin name="htmltext" url="../plugins/textfield.swf" 
keep="false"
visible="false" 
enabled="true"
children="true"
handcursor="true"
zorder="0"
alpha="1.00" blendmode="normal"
smoothing="true"
origin="center"
width="500" height="300"
x="0" y="0"
scale="1"
onloaded=""
onover=""
onout=""
ondown=""
onup=""
onclick=""
background="true"
glow="0"
html="data:htmldata"
css="data:cssdata"
borderwidth="1"
bordercolor="0xFFFFFF"
backgroundcolor="0xFFFFFF"
selectable="false"
autosize="center"
/>

<plugin name="htmltext2" url="../plugins/textfield.swf" 
origin="center"
width="500" height="300" 
x="0" y="0" 
html="data:htmldata2" 
css="data:cssdata" 
borderwidth="1" 
bordercolor="0xFFFFFF" 
backgroundcolor="0xFFFFFF" 
alpha="0.0" 
blur="8" 
textblur="8" 
glow="6" 
glowcolor="0xFFFFFF" 
shadow="5" 
autosize="center" 
smoothing="true"
visible="false"
enabled="true"
/>    
 
</krpano>


The third xml is not important, that one is just a 'flat' pano with a hotspot to pano1 and works correct.

4

Saturday, November 28th 2009, 11:37pm

Hmm, no word wrap :(. Also my tabs don't work well here.

michel

Professional

Posts: 1,153

Location: ANDORRA

Occupation: TV

  • Send private message

5

Sunday, November 29th 2009, 1:23am

Hi,

Your pano1.xml (it's actually valkenburg1.xml ;)): has a parser error... there is a missing </font>:

Source code

1
2
3
4
5
6
7
8
<data name="htmldata">
<p>
<font face="Verdana, Arial, Helvetica, sans-serif" size="+4">
bla
<a href="event:action(hidewindow,htmltext);">Sluiten</a>
</font>
</p>
</data>

Quoted

The next thing is: how do I close the first textfield when the second shows up? I tried
set(plugin[htmltext2].enabled,true);
set(plugin[htmltext].enabled,false);
try using set(plugin[X].visible,true/false);

Source code

1
2
set(plugin[htmltext2].visible,true);
set(plugin[htmltext].visible,false);

Quoted

And another question: I want to make a pano with 10 textfield-hotspots (or maybe more or less ;)). Is it possible to make one action to close the active window? I don't like to have action hidewindow, hidewindow2, hidewindow3 ... hidewindow10. And the same for the actions to show the textfield. I want to have the same way of popping up, but with another text.
Try using only one textfield plugin... and change his htmldata content inside each action:

Source code

1
set(plugin[htmltext].html,data:htmldataX);


Your code would be:

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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
<krpano version="1.0.8">

<!-- set initial view -->
<view hlookat="0" vlookat="0" fov="90" maxpixelzoom="1.00" fovmax="150" />

<!-- the preview and pano image -->        
<preview type="SPHERE" url="valkenburg1.tiles/preview.jpg" />

<image type="SPHERE" multires="true" tilesize="554">
<level tiledimagewidth="20526" tiledimageheight="3662">
<sphere url="valkenburg1.tiles/l3_%0v_%0h.jpg" />
</level>

<level tiledimagewidth="10263" tiledimageheight="1831">
<sphere url="valkenburg1.tiles/l2_%0v_%0h.jpg" />
</level>

<level tiledimagewidth="5132" tiledimageheight="916">
<sphere url="valkenburg1.tiles/l1_%0v_%0h.jpg" />
</level>

</image>

<!-- hotspots -->
<hotspot name="pano2" url="pano2.png" ath="197.45" atv="-6.8" scale="0.4" zoom="true"
		alpha="0.6"
		onover="tween(alpha,1);tween(scale,0.7);"
		onout="tween(alpha,0.7);tween(scale,0.4);"
		onclick="looktohotspot(pano2); action(load2); lookto(0,0,150);"
		/>

<hotspot name="jaap"
		keep="false"
		visible="true" enabled="true" handcursor="true" capture="true" children="true"
		zorder="0"
		fillcolor ="0xffffff" fillalpha ="0.00" borderwidth ="2.0" bordercolor ="0xffffff" borderalpha ="0.50"
		fillcolorhover="0xffffff" fillalphahover="0.20" borderwidthhover="4.0" bordercolorhover="0xffffff" borderalphahover="0.80"
		fadeintime="0.150" fadeouttime="0.300" fadeincurve="1.100" fadeoutcurve="0.700"
		onover=""
		onhover="showtext(jaap);"
		onout=""
		ondown=""
		onup=""
		onclick="action(show_jaap);"
		>
<point ath="-156.2902" atv=" -3.0426" />
<point ath="-155.8229" atv=" -2.7695" />
<point ath="-155.2742" atv=" -2.3191" />
<point ath="-154.9528" atv=" -1.9167" />
</hotspot>

<hotspot name="hanneke"
		keep="false"
		visible="true" enabled="true" handcursor="true" capture="true" children="true"
		zorder="0"
		fillcolor ="0xffffff" fillalpha ="0.00" borderwidth ="2.0" bordercolor ="0xffffff" borderalpha ="0.50"
		fillcolorhover="0xffffff" fillalphahover="0.20" borderwidthhover="4.0" bordercolorhover="0xffffff" borderalphahover="0.80"
		fadeintime="0.150" fadeouttime="0.300" fadeincurve="1.100" fadeoutcurve="0.700"
		onover=""
		onhover="showtext(hanneke);"
		onout=""
		ondown=""
		onup=""
		onclick="action(show_hanneke);"
		flying="0"
		>
<point ath="-164.1424" atv="  0.8945" />
<point ath="-163.9564" atv="  0.3221" />
<point ath="-163.8992" atv=" -0.0215" />
<point ath="-163.5129" atv=" -0.4224" />
</hotspot>
  
<data name="htmldata">
<p>
<font face="Verdana, Arial, Helvetica, sans-serif" size="+4">
bla
<a href="event:action(hidewindow,htmltext);">Sluiten1</a>
</font>
</p>
</data>

<data name="htmldata2">
bla
<a href="event:action(hidewindow,htmltext);">Sluiten2</a>
</data>

 <data name="cssdata">
a{ text-decoration:underline; font-weight:bold; }
a:hover{ color:#885500; }
</data>

<action name="show_jaap">
set(plugin[htmltext].html,data:htmldata);
set(plugin[htmltext].y,-1500);
tween(plugin[button].alpha,0,,,set(plugin[button].visible,false));
tween(plugin[htmltext].alpha,1,0);
tween(plugin[htmltext].textblur,0,0);
tween(plugin[htmltext].blur,0,0);
set(plugin[htmltext].visible,true);
set(plugin[htmltext].enabled,true);
tween(plugin[htmltext].y,0);
</action>

<action name="show_hanneke">
set(plugin[htmltext].html,data:htmldata2);
set(plugin[htmltext].enabled,true);
tween(plugin[htmltext].blur,8,0);
tween(plugin[htmltext].textblur,8,0);
set(plugin[htmltext].blur,8);
set(plugin[htmltext].textblur,8);
set(plugin[htmltext].visible,true);
tween(plugin[htmltext].blur,0);
tween(plugin[htmltext].textblur,0);
tween(plugin[htmltext].alpha,0.8);
</action> 
 
<action name="hidewindow">
set(plugin[%1].enabled,false);
tween(plugin[%1].alpha,0);
tween(plugin[%1].blur,20);
tween(plugin[%1].textblur,20,,,set(plugin[%1].visible,false));
</action>

<plugin name="htmltext" url="../plugins/textfield.swf" 
keep="false"
visible="false" 
enabled="true"
children="true"
handcursor="true"
zorder="0"
alpha="1.00" blendmode="normal"
smoothing="true"
origin="center"
width="500" height="300"
x="0" y="0"
scale="1"
onloaded=""
onover=""
onout=""
ondown=""
onup=""
onclick=""
background="true"
glow="0"
html=""
css="data:cssdata"
borderwidth="1"
bordercolor="0xFFFFFF"
backgroundcolor="0xFFFFFF"
selectable="false"
autosize="center"
/>
 
</krpano>


SAlut.

6

Sunday, November 29th 2009, 12:00pm


Your pano1.xml has a parser error... there is a missing </font>


Oops. Didn't copy-paste very well. It's ok in my xml. That was not the reason the texfield plugin doesn't work together with the radar. I still can't find out why.

Quoted

Try using only one textfield plugin... and change his htmldata content inside each action:

Source code

1
set(plugin[htmltext].html,data:htmldataX);


Ok, thx. Isn't there a possibility to use the same action every time, but change only the data (something like

Source code

1
onclick="action(hidewindow,htmltext2); action(show_jaap,jaaptext);"

but then something that works ;))?

Quoted

Your code would be:


Thanks for your help!

Tuur

Sage

Posts: 3,116

Location: Netherlands

Occupation: Krpano custom coding / Virtual Tours / Photography / Musician / Recording engineer

  • Send private message

7

Sunday, November 29th 2009, 1:02pm

Hi Maaike,
i think that's what michel allready did with this:

set(plugin[htmltext].html,data:htmldataX);

Tuur *thumbsup*
http://www.virtualtuur.com
Skype:studiotuur

8

Sunday, November 29th 2009, 1:24pm

Ok, what I did now:

Source code

1
2
3
4
5
6
7
8
9
	<hotspot name="jaap"
	blabla
	onclick="set(htmldata,jaap); action(hidewindow,htmltext2); action(show_text);"
	blabla

	<hotspot name="hanneke"
	blabla
	         onclick="set(htmldata,hanneke); action(hidewindow,htmltext); action(show_text);"
	blabla


And:

Source code

1
2
3
4
5
6
7
8
9
10
11
action name="show_text">
		if(htmldata == jaap, set(plugin[htmltext].html,data:htmldata));
		if(htmldata == hanneke, set(plugin[htmltext].html,data:htmldata2));		
		set(plugin[htmltext].y,-1500);
		tween(plugin[htmltext].alpha,1,0);
		tween(plugin[htmltext].textblur,0,0);
		tween(plugin[htmltext].blur,0,0);
		set(plugin[htmltext].visible,true);
		set(plugin[htmltext].enabled,true);
		tween(plugin[htmltext].y,0);
	</action>


This works well. Can I make it shorter?

The not-working textfields had nothing to do with the radar-plugin, but with the loadpano-action. The flag should be 'merge', not 'keepall'. And I added 'keep="all"' to every plugin that is used by the radar.

This post has been edited 2 times, last edit by "maaike" (Nov 29th 2009, 1:49pm)


michel

Professional

Posts: 1,153

Location: ANDORRA

Occupation: TV

  • Send private message

9

Sunday, November 29th 2009, 2:15pm

Hi,

Instead of a custom variable like set(htmldata,jaap); to check for, try to set directly the htmldata of the textfield plugin... set(plugin[htmltext].html,data:htmldataX);... like this:

Source code

1
2
3
4
5
6
7
8
9
<hotspot name="jaap"
	blabla
	onclick="set(plugin[htmltext].html,data:htmldata); action(hidewindow,htmltext2); action(show_text);"
	blabla

<hotspot name="hanneke"
	blabla
	onclick="set(plugin[htmltext].html,data:htmldata2); action(hidewindow,htmltext); action(show_text);"
	blabla


Now, the if statements inside your action(show_text) are not needed...

Another way would be to pass a parameter to your action(show_text)... action(show_text,PARAMETER)... ( note that this is already used in the action(hidewindow) )...
So the code would be:

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<hotspot name="jaap"
	blabla
	onclick="action(hidewindow,htmltext2); action(show_text,data:htmldata);"
	blabla

<hotspot name="hanneke"
	blabla
	onclick="action(hidewindow,htmltext); action(show_text,data:htmldata2);"
	blabla

<action name="show_text">
		set(plugin[htmltext].html,%1);
		set(plugin[htmltext].y,-1500);
		tween(plugin[htmltext].alpha,1,0);
		tween(plugin[htmltext].textblur,0,0);
		tween(plugin[htmltext].blur,0,0);
		set(plugin[htmltext].visible,true);
		set(plugin[htmltext].enabled,true);
		tween(plugin[htmltext].y,0);
	</action>

note in line 12 the %1.... more info about how to pass parameters to an action http://krpano.com/docu/actions/#action

SAlut.

10

Sunday, November 29th 2009, 3:34pm

Ok, thanks, that's better!

I do not fully understand the %1-thing. I copied the 'hidewindow' from the textfield-example. But I don't understand yet why hidewindow uses %1, and hidewindow2 not.

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
	<action name="hidewindow">
		set(plugin[%1].enabled,false);
		tween(plugin[%1].alpha,0);
		tween(plugin[%1].blur,20);
		tween(plugin[%1].textblur,20,,,set(plugin[%1].visible,false));
	</action>
	
	<action name="hidewindow2">
		set(enabled,false);
		tween(alpha,0);
		tween(blur,20);
		tween(textblur,20,,,set(visible,false));
	</action>

michel

Professional

Posts: 1,153

Location: ANDORRA

Occupation: TV

  • Send private message

11

Sunday, November 29th 2009, 4:08pm

Hi,

Quoted

I do not fully understand the %1-thing.
%1 correspond to the first argument given in the action call:
action(show_text,data:htmldata);
so,
set(plugin[htmltext].html,%1);
correspond to:
set(plugin[htmltext].html,data:htmldata);

Take a look to the action doc for more explaination: http://krpano.com/docu/actions/#action

Quoted

I copied the 'hidewindow' from the textfield-example. But I don't understand yet why hidewindow uses %1, and hidewindow2 not.
I think there is not particular reason why one use parameters and the other do not... It is probably because this is an example and Klaus show us different ways to do (helping us to learn krpano characteristics ;-) ).
Notice that hidewindow2 actions apply only for the plugin on that actions... hidewindow is more generic thanks to the fact that it use parameters to tell what plugin to hide...

SAlut.

Similar threads