It's valid both in a frame script in an IDE and in an AS3 class compiled via mxmlc. I suspect it's also valid in an <mx:script> block, but I didn't bother testing.
Actually give it a try before telling me it doesn't work. :) On Thu, Mar 27, 2008 at 6:59 PM, Steven Sacks <[EMAIL PROTECTED]> wrote: > Valid where? If that's in a class function and i is not a class > variable, then the compiler will complain that you're using an > undeclared variable. > > > Cory Petosky wrote: > > I guess I should have provided an example when I mentioned no block > > level scoping. Try this on for size: > > > > for (i = 0; i < 10; ++i); // Do nothing but increment i > > var i:int; > > trace(i); > > > > This is totally valid code and will trace 10! ALL variable > > declarations in a function, regardless of the block the variable is > > declared in, are performed as the function is pushed on the stack. > > > > > > _______________________________________________ > Flashcoders mailing list > Flashcoders@chattyfig.figleaf.com > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > -- Cory Petosky : Lead Developer : PUNY 1618 Central Ave NE Suite 130 Minneapolis, MN 55413 Office: 612.216.3924 Mobile: 240.422.9652 Fax: 612.605.9216 http://www.punyentertainment.com _______________________________________________ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders