A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: for loop not working for the life ofme

  1. #1
    FK M.D. pheck's Avatar
    Join Date
    Jul 2001
    Location
    MN
    Posts
    807
    Code:
    //item
    var sum="";
    for (i=0; i < numAuctions; i++) {
    	sum += Auction_URL[i] + "\n";
    }
    trace(sum);
    item=sum;
    this is on my main timeline with a stop(); after it. numAuctions is a var I have loaded in and it is equal to 4. (I know b/c i traced it right before this code.) Auction_URL[0--->3] give all real values. when i do it manually (no for loop), it works:

    Code:
    item=Auction_URL[0]+"\n"+Auction_URL[1]+"\n"+Auction_URL[2]+"\n"+Auction_URL[3]+"\n";
    outputs what it should when i trace. what is the problem here? if you can get this you are a real winner b/c it's been killng me for hours and hours. thanks in advance.

  2. #2
    Senior Member catbert303's Avatar
    Join Date
    Aug 2001
    Location
    uk
    Posts
    11,222
    I'm assuming you're not getting any flash player running slowly errors, so I guess the loop is working fine, in which case all I can think of trying is (i'll use j instead of i so it doesn't go italic),

    sum="";
    for (j = 0; j < numAuctions; j++) {
    addToString = Auction_URL[j] + "\n";
    sum += addToString;
    }

    This probably won't work, but it could be worth at least trying

  3. #3
    FK M.D. pheck's Avatar
    Join Date
    Jul 2001
    Location
    MN
    Posts
    807
    thanks a lot for trying but it still doesn't work. i don't think it's even going into the loop because tracers don't work in there.....

  4. #4
    Senior Member catbert303's Avatar
    Join Date
    Aug 2001
    Location
    uk
    Posts
    11,222
    In that case, have you tried doing

    for (j = 0; j < 4; j++) {


    }

    if you're importing numActions from a file maybe its a string "4" not 4 (clutching at straws here )

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