Hi,
thanks - great example!
The problem here is that the switch action is internally always comparing strings/texts (case-insensitive-strings).
But the 'scale' and 'alpha' variables are Numberic variables and are only storing the value, so when setting the value to 1.0 and reading it out again later, it will become just '1' - and this '1' converted to a string will not match the '1.0' and therefore the switch stops there.
I will think about an internal workaround for this case - maybe through detecting if the variables are numbers and then directly comparing the numbers...
A workaround for now, would be to use an additional custom variable and modifying that through switch() and then to copy the result. These custom variables will be String variables and therefore not doing any type-conversion.
e.g. see the 'newscale' variable in this example:
|
Quellcode
|
1
|
<plugin name="scale-work" url="scale-nonwork.jpg" align="center" y="+100" scale="0.5" newscale="0.5" onclick="switch(newscale, 0.5, 0.7, 1.0); copy(scale,newscale);"/>
|
Best regards,
Klaus