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...

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

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

    Code
    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.

  • Hi,

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

    Code
    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.

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

    or any other suggestions?

    best regards,
    Klaus

  • How I Faso for this command work?


    Code
    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);"
    	         />
  • Hi,

    How I Faso for this command work?

    Code
    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:

    Code
    addhotspot(nadirlogo);
    set(hotspot[nadirlogo].url, 'logo_chao.png');
    set(hotspot[nadirlogo].atv, 90);
    set(hotspot[nadirlogo].distorted, true);
    ...

    best regards,
    Klaus

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!