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

Tuesday, January 4th 2011, 5:12pm

need help with "loadstyle" function

Hi,

exemple of my problem :

I have an hotspot called toto.

If i write : hotspot[toto].loadstyle(mystyle); --> no error

But, if i use a variable that contains the name toto :
set(hotspot_name,"toto");
then i can't write this :
hotspot[get(hotspot_name)].loadstyle(mystyle);

The player return ---> WARNING: unknown action command: hotspot[get

As anyone an idea about this ?

Thanks for your help.

Eric

2

Saturday, January 8th 2011, 8:09am

Try this

Source code

1
hotspot[%hotspot_name].loadstyle(mystyle);

3

Sunday, January 9th 2011, 9:48am

Try this

Source code

1
hotspot[%hotspot_name].loadstyle(mystyle);
Thank you very much Srisa.

It works very well ! *smile*

Zephyr

Professional

Posts: 994

Location: Netherlands

Occupation: Web developer

  • Send private message

4

Monday, September 12th 2011, 11:56pm

sorry for ressurecting this old topic. But what is %? a replacement/alternative for get(variablename)?
3d childrens game using krpano Game
Minify your xml with my krpano XML Compressor
Krpano XML Parsing Error Checklist
Available for hire (krpano xml, javascript, actionscript, flash, php and ipad plugins).

5

Tuesday, September 13th 2011, 2:51pm

Hi,
hotspot[get(hotspot_name)].loadstyle(mystyle);

The player return ---> WARNING: unknown action command: hotspot[get
this was a bug/limitation in the internal parser,
it was fixed now in the latest 1.0.8.14 release (build 2011-09-12),

Quoted

But what is %? a replacement/alternative for get(variablename)?
partially, only for using simple variables as array index - the % syntax is older then the get() syntax,
the get() syntax is the newer and better one because it allows using full path variables there,
e.g. element[%var].var - will work,
but element[%element[%var].var].var - will not work,
but with get() - element[get(element[get(var)].var)].var - it will work

best regards,
Klaus