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

    Einmal editiert, zuletzt von mstoss (9. Mai 2013 um 21:00)

  • 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

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!