Sorry guys, for bothering you with the ever basic problems. My scripting knowledge has not really improved over the years.
So, here's my problem.
I have got a language switch (via the xml combo box) to set a variable to "en" or "de" for english/german language.
I did place jpgs in their respective languages into two folders "en" and "de".
The idea is, to show the right image to the user depending on the chosen language. Sounds simple. Maybe it is, maybe it isn't, as some would say - I'm no expert.
<!-- v_lang is defined as onstart="set(v_lang,de); " -->
<combobox name="sprache" design="default" align="righttop" >
<item name="en" caption="EN" onclick="set(v_lang,en);" />
<item name="de" caption="DE" onclick="set(v_lang,de);" />
</combobox>
<hotspot name="hs_box5" ath="88" atv="15" style="infospotstyle" onclick="a_popupinfo(box5start);" />
<layer name="box5start" type="image" tag="" url="stills/de/aufmacher_box5.jpg" children="true" align="center" style="infobasisstyle" >
<layer name="close" type="image" url="skin/close.png" distorted="false" align="righttop" y="20" x="20" parent="box5start" onclick="a_popoutinfo(box5start);"/>
<layer name="box5" type="image" tag="" url="box5-hs.jpg'" style="infoimagestyle" parent="box5start" x="34" onclick="a_popupdetails(box5detail);"/>
<layer name="box5plus" type="image" tag="" url="box5plus-hs.jpg" style="infoimagestyle" parent="box5start" x="317" onclick="a_popupdetails(box5plusdetail);"/>
<layer name="box5luft" type="image" tag="" url="box5luft-hs.jpg" style="infoimagestyle" parent="box5start" x="535" onclick="a_popupdetails(box5luftdetail);"/>
</layer>
Display More
The first layer has a hard coded url to show you, what I want to achieve. I tried with the very basic image name and add the path according to this post , but that did not work, I went crazy in my IFs like this:
if (v_lang == 'en',
trace('Sprache ist englisch'),
if ( layer.tag == 'img', <!-- I tried to attach tags to my layers as in the example, took them away again -->
for (set(i,0), i LT layer.count, inc(i),
calc(v_path, 'stills/en/' + layer[get(i)].url);
set(layer[get(i)].url, get(v_path));
trace(layer[get(i)].url);
);
...
I tried to use the calc action directly then, but that did not work either - probably because I don't know how to use it correctly. Something in the line with url="calc:'%CURRENTXML%/stills/' + get(v_lang) + '/box5-hs.jpg'"
Is there any smart way to achieve this? It's only one tiny part of the url that has to be changed according to a simple variable. That has to be easy... somehow... or not?
I really, really... really appreciate some help with this.
Michael