Yeah, but what if you're doing an enumeration class, like so:

class TransitionState {
        private function TransitionState() {
        }
        public static var NOT_PLAYED_IN:TransitionState = new
TransitionState();
        public static var PLAYING_IN:TransitionState = new
TransitionState();
        public static var PLAYED_IN:TransitionState = new
TransitionState();
        public static var PLAYING_OUT:TransitionState = new
TransitionState();
        public static var PLAYED_OUT:TransitionState = new
TransitionState();
}

I want to be able to assume that these are the only 5 TransitionState
objects in existence! (Okay, somebody could extend the class and make
more--are they adding "final" in AS3.0?)

Or what about static method classes? Why should something like this be
allowed?:

var stupid:Math = new Math();

Or, to return to the original topic, what if you want to do a
pseudo-abstract class?

Saying it's not ECMAScript doesn't fully answer the question--what is
ECMAScript's rationale for not allowing private constructors?
--
T. Michael Keesey

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of eka
Sent: Tuesday, July 11, 2006 11:45 AM
To: Flashcoders mailing list
Subject: Re: [Flashcoders] Abstract classes in AS3?

private constructor is not ECMAScript !

to create a Singleton you can use a simple object inherit "internal"
class,
it's more clean :)

links about this subject : http://blog.jasonnussbaum.com/?p=112

french discussion about this subject :
http://groups.google.com/group/FCNG/browse_thread/thread/544f79b0b223b15
a/e2b2527f81678da7?lnk=st&q=constructeur+AS3&rnum=1#e2b2527f81678da7



PS : sorry for my english ^_^

EKA+ :)



2006/7/11, Weyert de Boer <[EMAIL PROTECTED]>:
>
> Why is it removed?
> _______________________________________________
> 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
>
_______________________________________________
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

_______________________________________________
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