Sie sind nicht angemeldet.

1

Dienstag, 4. Januar 2011, 17:12

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

Samstag, 8. Januar 2011, 08:09

Try this

Quellcode

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

3

Sonntag, 9. Januar 2011, 09:48

Try this

Quellcode

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

It works very well ! *smile*

Zephyr

Profi

Beiträge: 1 003

Wohnort: Netherlands

Beruf: Web developer

  • Nachricht senden

4

Montag, 12. September 2011, 23:56

sorry for ressurecting this old topic. But what is %? a replacement/alternative for get(variablename)?

5

Dienstag, 13. September 2011, 14:51

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),

Zitat

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