Most of the time when an error message points to the end of the code, something just about anywhere in the code tripped things up...
for(int i = 0; i < 5; i++)
for(i = 0; i < 5; i++)
Even if there was an int data type in AS2, the way you utilized it would not be correct.
Thanks for the answer. It worked perfectly. I still had a logic error, but I cleaned that up no problem.
Question, however: You said that if "int" were a type in AS2, it still wouldn't work.
for(int i = 0; i < iALength; i++) works fine in java...
did you just mean that you can't have "int" in the for loop in AS?
I hate saying can't, or doesn't, 'cause I sometimes find out I'm wrong, but that also means I learned something, so it's not so bad. So let me step out on a limb and say, for what I know, AS2 does not have an int data type, just a Number type. AS3 does have both int and uint data types.
If AS2 did have an int data type, it would be specified/utilized like any other data type is...
var i:int = 0;
AS isn't java and does not caste variables with the type leading in as you did... pretty much every instance/variable is created in the form of:
Ohhhhh. Ok. I see what you're saying.
Yea, I'm just learning this stuff (unfortunately on Flash MX...) and I didn't even know how to declare a variable type hehe. Except to use "_root.varName"
Thanks for the help.
You're welcome... being that you're using MX, the only time you need to really worry about defining types is when you need to get them to agreee with what you're trying to do. I don't think I evenr defined the types up front. I would usually just be doing something like Number(text_field.text) if I needed a string to suddenly become a number for a calculation.
AS3 is a different story though, and you almost always need to cast the type in order to get things working properly... even when the compiler can see the types that are involved, it will kick out errors simply because you didn't specifically designate them.