PDA

View Full Version : Sports Start Gen Help



KIERIOSHIMOTO
April 24th, 2006, 02:42 PM
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??

KIERIOSHIMOTO
April 25th, 2006, 02:12 AM
anyone know anything that might be able to help?

KIERIOSHIMOTO
April 25th, 2006, 06:32 PM
if nobody knows how to fix my current code does andybody know and alternate method?

KIERIOSHIMOTO
April 25th, 2006, 06:44 PM
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;
}
}