Changing controls

Does anyone know how to do this in a Flash game?
Please

It’s kinda complicated, so I’ll just give you a .fla