Sports Start Gen Help

Im creating a rugby league stat generator (enter play stats, simulates game, returns with score eg.) but i’ve hit a wall.

On Frame Code

team1num = 1;
stop ();
function joinTeam1 (player) {
    if (!player.picked) {
        player._x = eval ("team1Spot" + team1num)._x;
        player._y = eval ("team1Spot" + team1num)._y;
        player.picked = true;
        team1num++;
    }
}

On player Code

on(release){
_root.joinTeam1 (this);
}

And the instance name for my player spot is “team1Spot”.

But when i click the player he doesn’t move from the available players list, to the team1 list. Any ideas??

anyone know anything that might be able to help?

if nobody knows how to fix my current code does andybody know and alternate method?

nevermind, nathan99 gave me a working code:


stop();
var team1num:Number = 0;
function joinTeam1(player) {
	if (!player.picked) {
		player._x = team1Spot._x;
		player._y = team1Spot._y+(team1Spot._height*team1num);
		team1num++;
		player.picked = true;
	}
}