What is the desired behavior?
I see it working fine, it shows the "walk forward" animation only when walking towards the pointer, same for the other directions.
If what you're after is always having the feet point to the proper direction, then you would need to have them in a separate sprite. Since this seems to be 3D, you could render the torso again and then the legs, separately, then move them together and set the torso angle towards the mouse, while setting the legs angle according to keys.
On a different note:
[quote="lucid":1q7iin1e]man, if only someone made a plugin that let you set controls at runtime[/quote:1q7iin1e]
We need a thread for uploading custom plugins, yes.
Whoa --> [quote:1q7iin1e]http://www.scirra.com/phpBB3/viewforum.php?f=29[/quote:1q7iin1e]
there is already. Lucid! upload!