Skip to main content
Inspiring
September 7, 2007
Answered

private constructor

  • September 7, 2007
  • 1 reply
  • 208 views
Hi,

I am just wondering why a constructor cannot be declared as private under AS 3.0?
It was possible under AS 2.0 and in many situation it may be logical to declare it as private, for example a class which instanciates its objects only through one of its public static classes.

Declaring a constructor as private just means that you don't want it to be instantiated by an external entity, doesn't it?

thanks
This topic has been closed for replies.
Correct answer ritpas
ok so I suppose it should be allowed in the future.

Thanks

1 reply

Inspiring
September 7, 2007
To answer your first question;
“Adobe has stated that this is because the ECMAScript specification is not yet complete, and they did not want to break forwards compatibility with the specification.”- Grant Skinner

Here is a link to the quote above;
http://www.gskinner.com/blog/archives/2006/07/as3_singletons.html
ritpasAuthorCorrect answer
Inspiring
September 7, 2007
ok so I suppose it should be allowed in the future.

Thanks