Ah, I see where things might go wrong now.
Code:
<Animation name="F-2_TaxiLdg_Light_Switch" guid="0aef10f5-4c5d-47c3-8e2e-5ae63e0474d9" length="50" type="Sim" typeParam2="F-2_TaxiLdg_Light_Switch" typeParam="AutoPlay" />
<PartInfo>
<Name>F-2_TaxiLdg_Light_Switch</Name>
<AnimLength>50</AnimLength>
<Animation>
<Parameter>
<Code>(L:F-2 Taxi Landing Light Switch, number) 25 * 25 +</Code>
<Lag>100</Lag>
</Parameter>
</Animation>
<MouseRect>
<Cursor>Hand</Cursor>
<TooltipText>Landing/Taxi Light Switch (%((L:F-2 Taxi Landing Light Switch, number))%{case}%{:-1}Taxi Light On - LMB/RMB: Switch Off%{:0}Off - LMB: Landing Light, RMB: Taxi Light%{:1}Landing Light On - LMB/RMB: Switch Off%{end})</TooltipText>
<MouseFlags>LeftSingle+RightSingle</MouseFlags>
<CallbackCode>
(M:Event) 'LeftSingle' scmp 0 == (M:Event) 'RightSingle' scmp 0 == or (L:F-2 Taxi Landing Light Switch, number) 0 != and if{ 0 (>L:F-2 Taxi Landing Light Switch, number) }
(M:Event) 'LeftSingle' scmp 0 == (L:F-2 Taxi Landing Light Switch, number) 0 == and if{ 1 (>L:F-2 Taxi Landing Light Switch, number) }
(M:Event) 'RightSingle' scmp 0 == (L:F-2 Taxi Landing Light Switch, number) 0 == and if{ -1 (>L:F-2 Taxi Landing Light Switch, number) }
(L:F-2 Taxi Landing Light Switch, number) 1 == (A:LIGHT LANDING, bool) ! and if{ (>K:LANDING_LIGHTS_TOGGLE) }
(L:F-2 Taxi Landing Light Switch, number) -1 == (A:LIGHT TAXI, bool) ! and if{ (>K:TOGGLE_TAXI_LIGHTS) }
(L:F-2 Taxi Landing Light Switch, number) 0 == (A:LIGHT LANDING, bool) and if{ (>K:LANDING_LIGHTS_TOGGLE) }
(L:F-2 Taxi Landing Light Switch, number) 0 == (A:LIGHT TAXI, bool) and if{ (>K:TOGGLE_TAXI_LIGHTS) }
</CallbackCode>
</MouseRect>
</PartInfo>
In the old switch code, the code line for resetting the switch to the middle position when the left or right mouse button was pressed and the switch was NOT in the middle was executed after the code line for the landing lights. This immediately reset the switch to the middle position when clicking it for landing lights because the left mouse button was pressed and the switch variable was first zero and then one, which activated the condition to reset the switch.
The taxi light switch worked because the code line was executed after the line for resetting the switch.
Switching the line positions is an easy solution, because the code is always read from top to bottom, so if the switch is in the middle, the first condition to reset the switch will not activate.
Also note the improvement to the tooltip, which will now indicate which mouse button must be pressed to change the switch position.
Hope this is understandable.