Sie sind nicht angemeldet.

1

Dienstag, 27. Juli 2010, 00:29

Plugin in variable?

Hi!

I have a panorama where a number of textfield pluging appears on user clicks. It acts like a tooltip. Is there any way to close previsiously opened textfield plugin?

Every time user clicks on some hotspot the textfield apears visible. Clicking on tooltip user can close it. Also, clicking on other hotspots brings user new tooltip.
Is there any way to remember current active textfield plugin so I can close it further?

This is my code:

Quellcode

1
2
3
4
5
6
7
8
9
	<action name="show_html_field">
		set(plugin[%1].y,-1500);
		tween(plugin[%1].alpha, get(HOTSPOT_OPACITY), 0.3);
		tween(plugin[%1].textblur,0,0);
		tween(plugin[%1].blur,0,0);
		set(plugin[%1].visible,true);
		set(plugin[%1].enabled,true);
		tween(plugin[%1].y,0);
	</action>


I've tried to set %1 to a variable to do like this:

Quellcode

1
2
3
4
5
6
7
8
9
10
11
12
13
	<action name="show_html_field">
		trace(plugin[get(CURRENT_TEXTFIELD)].name);
		set(plugin[get(CURRENT_TEXTFIELD)].visible, false);
	
		set(plugin[%1].y,-1500);
		tween(plugin[%1].alpha, get(HOTSPOT_OPACITY), 0.3);
		tween(plugin[%1].textblur,0,0);
		tween(plugin[%1].blur,0,0);
		set(plugin[%1].visible,true);
		set(plugin[%1].enabled,true);
		tween(plugin[%1].y,0);
		set(CURRENT_TEXTFIELD, get(%1));
	</action>


But this doesn't work. trace result is: "INFO: get(current_textfield)".

Any ideas?

2

Dienstag, 27. Juli 2010, 22:46

try

Quellcode

1
set(CURRENT_TEXTFIELD,%1);


Don't surround the %1 with a get(). The get will dereference the plugin name you pass in and will most likely return null to the set command. Thus, current_textfield is set to null. Tracing a variable that has been set to null prints the variable name, in this case "current_textfield".

Steve

3

Mittwoch, 28. Juli 2010, 16:28

Thanks for your reply Steve,

Seems like this will not work.

Here is an example:

Quellcode

1
2
3
4
        <action name="do">
		set(CURRENT_TEXTFIELD, %1);
		trace('will: ' + CURRENT_TEXTFIELD);
	</action>


The result of execution is:

Quellcode

1
INFO: 'will: ' + CURRENT_TEXTFIELD


Ofcourse, action 'do' is called with argument.

4

Mittwoch, 28. Juli 2010, 16:50

Hi,

there is no '+' for connecting strings in krpano,
trace with the variable with that code:

Quellcode

1
trace('will: ',CURRENT_TEXTFIELD);


best regards,
Klaus

5

Mittwoch, 28. Juli 2010, 17:33

Thanks all!

The problem solved - I downloaded the latest version.