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
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
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() {
}
}
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) {
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) ?
-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
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
7 matches
Mail list logo