Responding to two, here ...

>> ryanm wrote:
>>
>> Because global variables are contrary to the
>> basis of OOP, which is all about abstraction
>> and encapsulation. If you need to store
>> variables somewhere so that they can be
>> reached anywhere, use a singleton, or a static
>> class, or an application object, and so on.

        Okay, I'm with you.  That jibes with my understanding of OOP in
a universal sense.  In ActionScript, however, classes *are* properties
of the _global object, which is what prompted my question.  Programmers
in general may agree to avoid global variables in principle, and what
I'm hearing is that ActionScript programmers, in a sense, pretend
_global isn't being used unless invoked explicitly.

        Caveat:  By "pretend," I don't mean AS programmers are fibbers
... it's more like we agree to an anticipatory linguistic contrivance
while gearing up for AS3.  Right?  Same as we speak of strong typing in
AS2:  technically speaking, AS2 is not strongly typed.  Post-colon
syntax, at least currently, is a device for accommodating compile-time
error messages and code hinting.

> Tyler Wright wrote:
>
> _global is a perfect place to store application
> meta data [...] if you're building anything of
> significance (in size) you should have a class
> [...] This way every thing thrown the way of
> global vars is documented, type checked, and
> follows some sort of API.

        That makes perfect sense.


David
[EMAIL PROTECTED]

_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to