SOLVED: understanding switch(variable, value1, value2, value3)

  • Hello,

    I don't know why, but I seem to have some bug in this action. I don't know how to make the switch ... ahem.. switch:


    Code
    <action name="a_flip">
    			switch(hotspot[flip].alpha, 0.3,0.4,0.5);
    			trace(hotspot[flip].alpha); <!-- returns  1, the existing value -->
    			switch(hotspot[flip].url,hats2.jpg,hats3.jpg,hats4.jpg);
    			trace(hotspot[flip].url); <!-- returns hats1.jpg, the existing value  -->
    	</action>

    Any ideas?

    Michael

    Edited once, last by mstoss (May 9, 2013 at 9:00 PM).

  • Hi,

    when using switch with a list of options, then the current value must be also in this list.

    The switch action will search for the current value in the list and then takes the next one, but when the current value can't be found in the list nothing will happen.

    Best regards,
    Klaus

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!