Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dynamic attachMovie 1

Status
Not open for further replies.

dcushnie

Programmer
Feb 2, 2005
28
CA
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.

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;
}
 
With all the collective knowledge in this place does nobody know how to do this?
 
Code:
level = 4;
for(var i=1;i<level;i++){
   this.attachMovie("ball_mc","balls"+i,2+i);
   //balls[i-1]=ball;
   _level0["balls"+i]._x = 100*i;
   _level0["balls"+i]._y = 100*i;
}

Regards. Affiliate Program - Web Hosting - Web Design
After 25,000 posts, banned on FK, but proud not to have bowed down to them!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top