BGE switching action actuators using python

        if speed == 2:            cont.deactivate(run)
            cont.deactivate(idle)
            cont.activate(walk)
            print("walk_activated")
        
        if speed == 3:
            cont.deactivate(walk)
            cont.deactivate(idle)
            cont.activate(run)
            print("run_activated")
            
            
            #cont.activate(run)
        
        print("activating else")
        cont.activate(act)

I am working on a python movement system in BGE. I am trying to switch animations using python using the above code.

When I am running (if speed = 3) I want to deactivate my idle and walk animations, and play my run animation. If walking, want my walking animation, etc. The animations work fine if I only press one key at a time, but multiple cause an issues.

Let me explain:

When I start the game, my idle anims work fine, I press “W” and my walk anims work fine, but if I then press the shift key, the run animations don’t work, and then all my animations seem to freeze, none of them play.

I have a link to a sample blend file of my issue that has my full python file (walk.py)…
https://docs.google.com/open?id=0Bz170qNApm2AdWRPU010TjdPZ1E

Discovered I needed to change the priority settings in my action logic bricks to get this working.