create a class, declare a method on the prototype and try to access that method, its not availible in the instance of the class at all (throws a runtime exception).
in a prototyped language if i don't find a function on this instance i walk up the proto chain till i find that function. this does not work in AS3.
hence me saying it ain't prototyped
Patterns are not meant to be language specific. The way you implement a singleton may vary from language to language, but the abstraction is the same. That's the point.
So you may expect to do it differently in AS3. It's a new language with new features which hopefully will make us much more productive than with the old Java style stuff. Cheer up guys! This is exciting stuff. :)
Also some people would argue that singleton is a 'dead' pattern. :)
"AS3 is not a prototype language" - yes it is.
cheers
-michaelOn 2/10/06, Johannes Nel <[EMAIL PROTECTED]> wrote:so even if i create a private class that is only accecible in that package (and then on package level declare a accesor for it) the only way i can be certain that class will only be created once is by having nothing else in that package. this does not seem right.On 2/10/06, Matt Chotin < [EMAIL PROTECTED]> wrote:You have to simulate private constructors by having the constructor take a class that is inaccessible to other classes (namely putting that class in the same file as the singleton outside of the package block). Unfortunately I believe the rule is that the constructor of the class has to have the same visibility as the class itself. So public classes need public constructors, internal classes get internal constructors, etc.
Matt
From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Johannes Nel
Sent: Thursday, February 09, 2006 4:51 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] AS3 class constructors can't be private? Abstract classes?
abstract classes i am not expecting, private constructers i certainly hope for
On 2/9/06, Carlos Rovira <[EMAIL PROTECTED] > wrote:
Hi,
I was trying to migrate some classes from AS2 to AS3 and notice that can't mark the class constructor as private. Is that correct or there's a workaround? if not have plans to implement private constructors.
and abstract classes?
Thanks in advance.
--
::| Carlos Rovira
::| http://www.carlosrovira.com
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
SPONSORED LINKS
YAHOO! GROUPS LINKS
- Visit your group "flexcoders" on the web.
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
--
j:pn
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
SPONSORED LINKS
Web site design development Computer software development Software design and development Macromedia flex Software development best practice
YAHOO! GROUPS LINKS
- Visit your group "flexcoders" on the web.
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service .
--
j:pn
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
SPONSORED LINKS
Web site design development Computer software development Software design and development Macromedia flex Software development best practice
YAHOO! GROUPS LINKS
- Visit your group "flexcoders" on the web.
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service .
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
SPONSORED LINKS
Web site design development Computer software development Software design and development Macromedia flex Software development best practice
YAHOO! GROUPS LINKS
- Visit your group "flexcoders" on the web.
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service .
--
j:pn
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
Web site design development | Computer software development | Software design and development |
Macromedia flex | Software development best practice |
YAHOO! GROUPS LINKS
- Visit your group "flexcoders" on the web.
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.