Providing the actual project could help out answering your question more accurately.
The bit of code you show in your screenshot is just not enough.
Also, it means that when you click your button, the global variable "dir" changes to -1.
All events and actions are read and executed top to bottom.
Changing the value of dir to 1 in this excerpt is irrelevant.
Consider checking the "How do I FAQ" for Construct 2 for questions like those, it does contain a lot of implementations of different mechanics already, including how to set changing the directions of characters.