Understanding "for" loop iterations
How come every time I run this script:
code:
_root.trink_array = ["Carp", "Cod", "Bream"];
_root.trinity_array = new Array();
for (var g = 0; g<=2; g++) {
_root.trinity_array[g] = _root.trink_array[g];
some_str += "<br>"+_root.trinity_array[g];
}
_root.dym_txt.htmlText = some_str;
I get:
Undefined
Carp
Cod
Bream
Where does the “Undefined” come into things? I have only asked the script to fire 3 times so the first time through the text in position [0] in the script “Carp” should be printed out?