Hmm... it is within a class... and that's when I'm getting the warnings. Or
did you mean just in general to reiterate that variables are locally scoped
to functions and classes and not to for loops?
I should have mentioned in my subject that this is AS3. So far everyone's
alternatives and explanations make sense, I am just curious now as to the
reasoning. Either this is a change from AS2 -> AS3 or since AS2 wasn't as
strict, it let me do it before. Maybe the explanation lies in the ECMA
guidelines somewhere. Anyway, thanks for the discussion, gang.
-jonathan
On Mon, Mar 24, 2008 at 3:53 AM, Cor <[EMAIL PROTECTED]> wrote:
> Using it youre way is possible when you do it within a function or class
> because then they are private by default
>
> Other you could use it this way
> Example 1:
>
> for (var i:int = 0; i < someArray.length; i ++) {
> // do something cool
> }
>
> for (i = 0; i < someOtherArray.length; i ++) {
> // do something even cooler
> }
>
> -----------------------------------------------
> Example 2:
> var i:int; //or uint if I is never negative
>
> for (i = 0; i < someArray.length; i ++) {
> // do something cool
> }
>
> for (i = 0; i < someOtherArray.length; i ++) {
> // do something even cooler
> }
>
> No virus found in this outgoing message.
> Checked by AVG.
> Version: 7.5.519 / Virus Database: 269.21.8/1340 - Release Date: 23-3-2008
> 18:50
>
>
> _______________________________________________
> Flashcoders mailing list
> [email protected]
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
--
-jonathan howe :: 404.434.2321 :: 180 High St Apt 26 Portland, ME 04101
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders