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) {
pParent = tParent;
}
}
}
This compiles fine. But with inheritance this no longer works:
class Clarss {
var pRoot:Clarss2
function Clarss() {
}
}
class Clarss2 extends Clarss {
function Clarss2() {
}
}
Now the compiler gets confused by the circular reference and tells me
"**Error** C:\...Clarss.as: Line 1: The name of this class, 'Clarss',
conflicts with the name of another class that was loaded, 'Clarss'."
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 because otherwise it can't
compile.
You are mixing Classes and Instances. Classes inherit properties and
methods from other classes.
How the instances are linked together at execution time is another matter.
Read some Actionscript books and if you want to do something this
sophisticated read the design pattern book.
What you want to do is pretty easy if you design it right.
This is a very simple ActionScript application once you get your head
around the tools.
Actionscript and Java are pretty similar so you can read some books on
designing with Java if you can not get one of the ActionScript books.
Which books have you read. Perhaps other in the forum can comment on
those books and suggest books that they found helpful.
Are you defining each class in its own .as file?
Danny
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com