Re: [Flashcoders] private constructors in AS3.0?

2006-07-10 Thread eka
Hello :) use internal keyword it's more easy : http://groups.google.com/group/FCNG/browse_thread/thread/b16a38f8389803a0/8ff037af609e7b94#8ff037af609e7b94 text\Singleton.as -- package test { public const Singleton:_Singleton = new _Singleton(); } internal class

Re: [Flashcoders] private constructors in AS3.0?

2006-07-09 Thread Cédric Néhémie
Hi, I've trying to create singleton, and the best way i've fund is to create the instance direcly in the class declaration private static var _oInstance:MyClass = getInstance(); And to check if constructor is called in code I do that : public function MyClass () { if (_oInstance == null)

Re: [Flashcoders] private constructors in AS3.0?

2006-07-09 Thread elibol
That is nice, I like how you can assign functions to compile time variables. On 7/9/06, Cédric Néhémie [EMAIL PROTECTED] wrote: Hi, I've trying to create singleton, and the best way i've fund is to create the instance direcly in the class declaration private static var _oInstance:MyClass =

Re: [Flashcoders] private constructors in AS3.0?

2006-07-09 Thread Cédric Néhémie
Just a little error in the first code, it's not : if (_oInstance == null) but : if (_oInstance != null) I think you have rectify by yourself ;) That is nice, I like how you can assign functions to compile time variables. On 7/9/06, Cédric Néhémie [EMAIL PROTECTED] wrote: Hi, I've

Re: [Flashcoders] private constructors in AS3.0?

2006-07-09 Thread Weyert de Boer
I am told private constructors should jsut work fine (in AS2 though) ___ 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