Sie sind nicht angemeldet.

Graydon

Profi

  • »Graydon« ist der Autor dieses Themas

Beiträge: 614

Wohnort: Texas

Beruf: Industrial gas turbine services.

  • Nachricht senden

1

Sonntag, 3. Mai 2009, 05:22

using a variable in the url attribute

Can variables other than the %# (i.e. %1) be used within the url attribute?

I know you can do something like...

Quellcode

1
2
3
4
5
6
7
8
action(someaction, somevariable);

....

<action name="someaction"...
...
set(plugin[myplug].url, %1.jpg);
...


but I'd like to be able to do something similar to...

Quellcode

1
2
3
4
set(varA,my_special_value)
....

set(plugin[myplug].url, varA.jpg);


I've tried some variations... all without any luck.

Don't know if it's just not possible... or if I'm constructing incorrectly??

Thanks,

Graydon

edit: I found a "workaround" by resorting to some javascript to construct the "set..." function... but, I think that will limit the ability to "bundle" everything together in a single swf using krprotect... unless I've missed how to include some js functions within krpano / krprotect.

2

Montag, 4. Mai 2009, 11:30

Hi,

the next beta 8 will have the possibility to use get() everywhere to get the content of a varialbe,
e.g.

Quellcode

1
set(plugin[myplug].url, get(varA) );


but for adding also ".jpg" to this variable an action for joining string would be still needed,

what about something like "txtadd(destvar, string1, string2, string3, ...);" ?
or join() or strcat() or ... what would be a good name?

e.g.

Quellcode

1
txtadd(plugin[myplug].url, get(varA), ".jpg");


or any other suggestions?

best regards,
Klaus

Graydon

Profi

  • »Graydon« ist der Autor dieses Themas

Beiträge: 614

Wohnort: Texas

Beruf: Industrial gas turbine services.

  • Nachricht senden

3

Dienstag, 5. Mai 2009, 07:06

all would work for me since I'm learning as I go and can't get confused with any other past practices or nomenclature *g*

"txtadd" sounds like the simplest and most self-explaining of the bunch at this point in time... at least to me.

4

Mittwoch, 11. Mai 2011, 21:04

How I Faso for this command work?

How I Faso for this command work?


Quellcode

1
2
3
4
	var varnadirlogo="logo_chao.png";

		<hotspot name="nadirlogo"				 url=varnadirlogo	         ath="0"	         atv="90"	         distorted="true"	         scale="1.0"	         rotate="0.0"	         rotatewithview="true"	        onhover="showtext(Entre no Site - www.site.net);"	        onclick="openurl(http://www.site/,_blank);"
	         />


5

Montag, 16. Mai 2011, 22:54

RE: How I Faso for this command work?

Hi,
How I Faso for this command work?

Quellcode

1
2
3
4
var varnadirlogo="logo_chao.png";

<hotspot name="nadirlogo" url=varnadirlogo         ath="0"         atv="90"         distorted="true"         scale="1.0"         rotate="0.0"         rotatewithview="true"        onhover="showtext(Entre no Site - www.site.net);"        onclick="openurl(http://www.site/,_blank);"
         />

you are mixing up here some different codes...
there is no 'var' for defining variables like in Javascript/Actionscript,

the xml itself is static,
the actions are dynamic,

that means if you want dynamic code - use actions,
e.g. to add an hotspot and set the url:

Quellcode

1
2
3
4
5
addhotspot(nadirlogo);
set(hotspot[nadirlogo].url, 'logo_chao.png');
set(hotspot[nadirlogo].atv, 90);
set(hotspot[nadirlogo].distorted, true);
...


best regards,
Klaus

Ähnliche Themen