[flexcoders] Method variable scoping problem with Flex compiler

2008-12-04 Thread toofah_gm
I came across another scoping issue today that scared me. I sure wish that the scoping in the ActionScript language worked the same way C++, C#, Java, and others work! Here's the code: for each (var o:Object in myArray) { var myProblemObject:ProblemObject; if (some condition) {

RE: [flexcoders] Method variable scoping problem with Flex compiler

2008-12-04 Thread Seth Hodgson
, and as someone who regularly works in both I've been bitten by this more than once as well. Best, Seth From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of toofah_gm Sent: Thursday, December 04, 2008 2:32 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Method variable scoping

Re: [flexcoders] Method variable scoping problem with Flex compiler

2008-12-04 Thread Michael Prescott
*Why* it's different I can't tell you, but if you're being regularly surprised, it sounds like you might benefit from skimming through the language reference. This behavior is described on the

Re: [flexcoders] Method variable scoping problem with Flex compiler

2008-12-04 Thread Josh McDonald
AFAIK, It's different because that's the way it works in LISP by way of Scheme, JavaScript, and ECMAScript. -Josh On Fri, Dec 5, 2008 at 12:15 PM, Michael Prescott [EMAIL PROTECTED] wrote: *Why* it's different I can't tell you, but if you're being regularly surprised, it sounds like you

[flexcoders] Method variable scoping problem with Flex compiler

2008-08-15 Thread toofah_gm
It seems to me and my co-workers that the Flex compiler is broken when it comes to local variable scoping within methods. For example: for (var i:int=0; icount; i++) { // do something } for (var i:int=0; icount; i++) { // do something else } This gives a compiler warning stating that 'i'

Re: [flexcoders] Method variable scoping problem with Flex compiler

2008-08-15 Thread Maciek Sakrejda
@yahoogroups.com Subject: [flexcoders] Method variable scoping problem with Flex compiler Date: Fri, 15 Aug 2008 19:43:09 - It seems to me and my co-workers that the Flex compiler is broken when it comes to local variable scoping within methods. For example: for (var i:int=0; icount; i++) { // do

RE: [flexcoders] Method variable scoping problem with Flex compiler

2008-08-15 Thread Gordon Smith
Of Maciek Sakrejda Sent: Friday, August 15, 2008 12:54 PM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] Method variable scoping problem with Flex compiler This is variable hoisting in action: http://docs.huihoo.com/web/js/es4/core/definitions.html#hoist http://docs.huihoo.com/web/js