A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: mean mr loop

Hybrid View

  1. #1
    Senior Member
    Join Date
    Dec 2005
    Posts
    142

    mean mr loop

    I have the following code
    Code:
    for (i=1;i<=10;i++) {
    	help += 1;
    		["box"+i]onRelease = function() {
    	help = help;
    			trace("this is box "+help);
    		}
    		trace("box "+i+" has been set");
    	}
    when you click on each box, they all say "this is box 10"

    I want them to each say their correct number "this is box 1", "this is box 2"...ect Ive tryed many combos...none work.

  2. #2
    Senior Member cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,448
    PHP Code:
    for (i=1;i<=10;i++) 
    {
        
    this["box"+i].id i;
        
    this["box"+i].onRelease = function() 
        {            
            
    trace("this is box "+this.id);
        }
        
    trace("box "+i+" has been set");

    - The right of the People to create Flash movies shall not be infringed. -

  3. #3
    Senior Member
    Join Date
    Dec 2005
    Posts
    142
    once again cancerinform you are of great help, I knew it was going to be a simple thing like that, thanks!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center