Flipping objects vertically

In my intializeChar function i’ve got it so that when you move left it turns your char left by doing _root.grid.char._xscale *= -1;

But that makes it so that every frame that your going left it will switch from looking left to looking right. What I want is to have the char face left while moving left and afterwards keep it looking left. And when going right it’s the opposite, how do I do that?

function initializeChar() {
game.speed = 3;
game.path.char.swapDepths(10000);
game.char = {startx:1, starty:1, clip:game.path.char};
var x = (game.char.startx-1)*game.spacing+game.spacing/2;
var y = (game.char.starty-1)*game.spacing+game.spacing/2;
game.char.clip._x = x;
game.char.clip._y = y;
game.char.x = x;
game.char.y = y;
game.char.radius = game.char.clip.width/2;
}
function moveChar(dir) {
ob = game.char;
if (dir == “right”) {
var tempx = ob.x+ob.radius+game.speed;
var tempy = ob.y;
var cellx = Math.ceil(tempx/game.spacing);
var celly = Math.ceil(tempy/game.spacing);
var tempCell = game[“cell”+cellx+"
"+celly];
if (tempCell.type != 1) {
return;
} else {
_root.grid.char.gotoAndPlay(2);
ob.x += game.speed;
ob.clip.x = ob.x;
}
} else if (dir == “left”) {
var tempx = ob.x-ob.radius-game.speed;
var tempy = ob.y;
var cellx = Math.ceil(tempx/game.spacing);
var celly = Math.ceil(tempy/game.spacing);
var tempCell = game[“cell”+cellx+"
"+celly];
if (tempCell.type != 1) {
return;
} else {
_root.grid.char.gotoAndPlay(2);
_root.grid.char._xscale *= -1;
ob.x -= game.speed;
ob.clip.x = ob.x;
}
} else if (dir == “up”) {
var tempx = ob.x;
var tempy = ob.y-ob.radius-game.speed;
var cellx = Math.ceil(tempx/game.spacing);
var celly = Math.ceil(tempy/game.spacing);
var tempCell = game[“cell”+cellx+"
"+celly];
if (tempCell.type != 1) {
return;
} else {
_root.grid.char.gotoAndPlay(2);
ob.y -= game.speed;
ob.clip.y = ob.y;
}
} else if (dir == “down”) {
var tempx = ob.x;
var tempy = ob.y+ob.radius+game.speed;
var cellx = Math.ceil(tempx/game.spacing);
var celly = Math.ceil(tempy/game.spacing);
var tempCell = game[“cell”+cellx+"
"+celly];
if (tempCell.type != 1) {
return;
} else {
_root.grid.char.gotoAndPlay(2);
ob.y += game.speed;
ob.clip._y = ob.y;
}
}
}

For starters x is horizontal. When moving left, set the movie clips _xscale to -100 and when it’s moving right, to 100.