RPG:battle action script

Would this work,i have a button"actions",
on(release){
_root.player.gotoAndStop(“attack”);
}

then in the characters attack on the last fram i put _root.enemy.gotoAndStop(“atk”);

would that work