You are not logged in.

igor.socha

Intermediate

  • "igor.socha" started this thread

Posts: 200

Occupation: Photographer

  • Send private message

1

Thursday, December 20th 2012, 9:16am

how to substitute any number in the code?

Hi,
can I substitute this long code with simple one?
<action name="all_01on">
set(hotspot[spot_1].alpha,0);
set(hotspot[spot_2].alpha,0);
.
.
.
set(hotspot[spot_99].alpha,0);
set(hotspot[spot_100].alpha,0);
</action>

is it possible to substitude somehow all the numbers with one line of code? Thanx!
Best regards,
Igor Socha

Tuur

Sage

Posts: 3,839

Location: Netherlands

Occupation: Krpano custom coding / Virtual Tours / Photography / Musician / Recording engineer

  • Send private message

igor.socha

Intermediate

  • "igor.socha" started this thread

Posts: 200

Occupation: Photographer

  • Send private message

3

Thursday, December 20th 2012, 9:30am

so can U write it please?
I was watching on it before, I am watching now, but still I don ´t know what to do *g*
Best regards,
Igor Socha

4

Thursday, December 20th 2012, 10:30am

Hi,

e.g.

Source code

1
2
3
4
for(set(i,1), i LE 100, inc(i),
   txtadd(spotname,'spot_',get(i));
   set(hotspot[get(spotname)].alpha,0);
);


  1. the 'i' variable will loop from 1 to 100
  2. then for each loop the 'spotname' variable with 'spot_' and the 'i' value will be build
  3. then this name will be used to set the alpha of the hotspot

Best regards,
Klaus

igor.socha

Intermediate

  • "igor.socha" started this thread

Posts: 200

Occupation: Photographer

  • Send private message

5

Thursday, December 20th 2012, 10:36am

GREAT *thumbup*
MANY THANX!!!
Best regards,
Igor Socha