There are many ways you could do that but, check my cgpatel.co.uk, there you will find lot's info and tutorial, you will find out how to use it.
Example
you have a player animation with; Walk Right, Left, up, down, here what you should do is name your all animation like below;
ID_idle
ID_Right
ID_Left
ID_up
ID_down
now create Instance Text Variable and name it
Player_DIR and Right
now open your code window and type in
start of layout
Player.Player.dir
Player animation (ID_) player.DIR
what you just have done is give a variable to player DIRECTION with Player.Player.DIR
now when you want to change direction just use, say you want to walk UP and you want to change animation to UP, all you do is
Player.player.dir "up"
player animation (ID_) player.player.DIR