I dont like to ask questions that I know can be easily solved, but we all have our moments of stupidity. In my RPG engine I attach a movie clip to a variable, char. In a function I set char = _root.tiles.char; which works fine, no problems there. I can adjust char._x, that kinda crap, but my calls to gotoAndPlay or gotoAndStop wont work. How would I fix that?
function detectMovements()
{
char = _root.tiles.char;
_root.checkCharacter(char);
if ((Key.isDown(Key.UP) || Key.isDown(87)) && char.canGoUp == true) {
char.gotoAndPlay("walkingup"); // WONT WORK!!!!!!!
newY = char._y - int(_root.speed);
moveCharacter(char, char._x, newY);
} else if ((Key.isDown(Key.LEFT) || Key.isDown(65)) && char.canGoLeft == true) {
char.gotoAndPlay("walkingleft"); // WONT WORK!!!!!!!
newX = char._x - int(_root.speed);
moveCharacter(char, newX, char._y);
} else if ((Key.isDown(Key.DOWN) || Key.isDown(83)) && char.canGoDown == true) {
char.gotoAndPlay("walkingdown"); // WONT WORK!!!!!!!
newY = char._y + int(_root.speed);
moveCharacter(char, char._x, newY);
} else if ((Key.isDown(Key.RIGHT) || Key.isDown(68)) && char.canGoRight == true) {
char.gotoAndPlay("walkingright"); // WONT WORK!!!!!!!
newX = char._x + int(_root.speed);
moveCharacter(char, newX, char._y);
} else {
char.stop();
}
}