I am trying to make a little game here. In the game depending on what level thats how many balls will be on screen. With the code below all the balls i need will appear on screen but they won't appear in the location i want them to. If the level is set to 3 the code will add 2 more balls to the screen but instead of putting them at postions (100,100) and (200,200) like it is suppose to i get one ball at(0,0) and one at (200,200). And if i increase the level any higher all additionals balls are set at (0,0).
I have no idea what is going wrong here.
I have no idea what is going wrong here.
Code:
for(var i=1;i<level;i++){
this.attachMovie("ball_mc","ball",2+i);
balls[i-1]=ball;
balls[i-1]._x=100*i;
balls[i-1]._y=100*i;
}