Instead of a boolean instance variable, use a global variable (for example named "Direction") and on the key press set its value to either 0 or 1.
Then in the event that makes your character move, check what is the value of "Direction" and make the character move accordingly (when the value is 0 the character is going right and the sprite is not mirrored, when the value is 1 the character moves left and the sprite is mirrored).
If this still doesn't apply to your project, consider posting/attaching the exact capx for your project so we can investigate and answer according to the specificities of what you've implemented so far.