Dont ever give up.
When you use the for loop. . . . . you are essentially stopping everything that is happening and executing your FOR.
so. . .
for(i=0; i<10; i++)
{
print("i");
}
- for(i=0; i<10; i++)
- {
- print("i");
- }
this will concecutively count from 0 to 9 printing i everystep of the way.
Now. . . .when you nest these FOR loops within eachother you are doing the same thing. However, my quickest analogy for what is happening is to imagine a file cabinet. in the file cabinet is folders.
Your first for loop, counts or goes through all the folders.
your second for loop will go through all the files in a folder.
for(i=0; i<10; i++)
{
for(j=0; j<10; j++)
{
}
}
- for(i=0; i<10; i++)
- {
- for(j=0; j<10; j++)
- {
- }
- }
OK. . . I'll break this down. referencing a file cabinet.
the first for loop using I opens the file cabinet and runs through 10 folders.
when i=0, it will then loop 10 times doing the FOR j loop. or will count through 10 files. Then it runs the for I loop again. Moving to the next folder.. . . . I have a better example now. Lets run a simple counter.
for(i=0; i<3 i++)
{
for(j=0; j<3 j++)
{
print(j);
}
print(i);
}
- for(i=0; i<3 i++)
- {
- for(j=0; j<3 j++)
- {
- print(j);
- }
- print(i);
- }
THIS CODE WILL PRINT OUT THE FOLLOWING.
012
0
012
1
012
2
the 012 is the j var looping through the for loop.
the 0 is the i var being printed.
then 012 for j because it runs the loop again.
then 1 is the i var printed
etc. . . this will repeat as many times as declared.
NOW, I AM NOT QUITE SURE WHAT YOU ARE LOOKING FOR?????
are you trying to move a object in flash by looping through coords?
Or are you trying to concatenate the "balls" with your number?
when you concatenate something, you are combining them into one string. So you would have to change ther var type and use a separte variable.
If for every time that your var i exists, you only want 1 h var to exist, why are you using a for loop for your h? Can you not just declare a single variable within the original loop?
Also, you may want to try to embed your coding into a movie clip, and then use the looping of that movie clip to constantly update your variables.. . . .
Hope I have helped in some degree. If I had a better example of your desired effect, I could perhaps be more precise in my explanation/theory.
Good luck