Re: [Flashcoders] Compiling with self-reference

2007-03-23 Thread Hans Wichman
Hi, you said: restrictive not to be able to refer to a superclass within a subclass - that's enforcing an arbitrary design principle. But that's not what you are doing: you are referring to a subclass within a superclass. And with this So it seems pretty reasonable to me that all my objects

Re: [Flashcoders] Compiling with self-reference

2007-03-22 Thread Hans Wichman
Hi, this class Clarss { var pRoot:Clarss2 function Clarss() { } } class Clarss2 extends Clarss { function Clarss2() { } } looks like a design error to me. One of the reasons you would use inheritance is polymorphism, and reducing complexity. A super class having to

Re: [Flashcoders] Compiling with self-reference

2007-03-22 Thread Hans Wichman
ps if you still need to do what you are trying, compiling twice or thrice might help:) On 3/22/07, Hans Wichman [EMAIL PROTECTED] wrote: Hi, this class Clarss { var pRoot:Clarss2 function Clarss() { } } class Clarss2 extends Clarss { function Clarss2() { } }

Re: [Flashcoders] Compiling with self-reference

2007-03-22 Thread Ron Wheeler
Danny Kodicek wrote: Slightly complicated and not terribly important but annoying: It's possible for a class to compile while self-referring: class Clarss { var pParent:Clarss; function Clarss(tParent:Clarss) { if (tParent != undefined) {

RE: [Flashcoders] Compiling with self-reference

2007-03-22 Thread Alain Rousseau
Hi Danny, Maybe make it a public var pParent:Clarss; or if you don't want your var to be accessed directly outside the class (best practice) class Clarss { private var _pParent:Clarss; function Clarss(tParent:Clarss) { pParent = (tParent != undefined) ?

RE: [Flashcoders] Compiling with self-reference

2007-03-22 Thread Danny Kodicek
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Hans Wichman Sent: 22 March 2007 12:39 To: flashcoders@chattyfig.figleaf.com Subject: Re: [Flashcoders] Compiling with self-reference Importance: High Hi, this class Clarss { var

RE: [Flashcoders] Compiling with self-reference

2007-03-22 Thread Danny Kodicek
Danny Kodicek wrote: It's a shame: My object structure has a bunch of objects in a tree structure, all of which inherit the same base class. I'd like them all to have a reference to the top-level node object, but I have to refer to it as an Object instead of its actual class name