I should have expressed myself more precisely.
The else actions are very different in my case......not exclusively like in the example at the beginning.
That's why I wanted to know how to represent the syntax in this case as an if (action). But thanks for the help anyway
if(layer[xtUfer_4].html === 'pause ▐▐ ',
set(layer[xtUfer_4].html, 'Play ▶ ');
,
set(layer[xtUfer_4].padding,10);
set(layer[xtUfer_4].roundedge,20);
set(layer[xtUfer_5].visible,false););
However, in this particular case I am faced with an absolute puzzle. In this case I did indeed start with a switch(action).
set(layer[xtUfer_4].onclick, pausesoundtoggle(xtUfer);
switch(layer[xtUfer_4].html, 'Play ▶ ', 'Pause▐▐ '););
after that didn't work, I tried to solve the problem with an if(action)
set(layer[xtUfer_4].onclick, pausesoundtoggle(xtUfer);
if(layer[xtUfer_4].html === 'pause ▐▐ ',
set(layer[xtUfer_4].html, 'Play ▶ ');
,
set(layer[xtUfer_4].html, 'pause ▐▐ '););)
after all that didn't work, I tried replacing the swich(action) with a simple set(action) for test purposes, which surprisingly worked
set(layer[xtUfer_4].onclick, pausesoundtoggle(xtUfer);
set(layer[xtUfer_4].html, 'Play ▶ '););
In the meantime I have tried a different approach; unfortunately, just as unsuccessfully.
I have decided to upload the example I am working on so that it is not so abstract.
In this project we use an auditour for the first time. Switchable with the button gotoAudiotour (screenright)
Hall360Tirol Brockenweg
here is the code that transforms the text hotspots into the desired audio hotspots
onresize="calc(hotspot[xtUfer].ath_sound,hotspot[xtUfer].ath + 15);
callwhen(hotspot[xtUfer].audio == true,
set(layer[xtUfer_33].height,40);
set(layer[xtUfer_4].padding,10);
set(layer[xtUfer_4].roundedge,20);
set(layer[xtUfer_4].html,);
set(layer[xtUfer_5].visible,false);
set(layer[xtUfer_4].onclick, pausesoundtoggle(xtUfer); );
if(sound[xtUfer].paused, set(layer[xtUfer_4].html, 'Pause ▶') , playsound_at_hv(xtUfer,'get(hotspot[xtUfer].audio_url)',get(hotspot[xtUfer].ath_sound),0,100,false,1,30, ); set(layer[xtUfer_4].html, 'Pause▐▐') );
callwhen(hotspot[xtUfer].audio == false,
destroysound(xtUfer);
set(layer[xtUfer_33].height,get(hotspot[xtUfer].vector_height));
set(layer[xtUfer_4].padding,4);
set(layer[xtUfer_4].roundedge,0);
set(layer[xtUfer_4].html, get(hotspot[xtUfer].primus));
set(layer[xtUfer_5].visible,true);
set(layer[xtUfer_4].css, 'color:#fff;font-size:14px;');
set(layer[xtUfer_4].backgroundcolor,get(hotspot[xtUfer].primus_color));
set(layer[xtUfer_4].onclick,get(hotspot[xtUfer].ziel));))"
Display More
the play pause switch is now in the if(sound[xtUfer].paused, action placed. it doesnot work even