Andreas,
If I'm understanding things correctly, this may be something to consider:
AS FILE #1:
-----------
interface as.memomaps.model.Topic {
function doSomething():Void;
function doSomethingElse():Void;
}
AS FILE #2:
-----------
import flash.geom.*;
import as.memomaps.model.Topic;
class as.memomaps.model.GroupReference implements Topic {
public function someMethod():Void {
// function code...
}
// **** interface implementation ****
public function doSomething():Void {
// implementation code for the interface...
}
public function doSomethingElse():Void {
// implementation code for the interface...
}
}
You could then do all the support work (code) in the GroupReference class,
and implement the Topic class in whichever object that requires the
functionality in your project. This of course assumes that each of classes
that implements the Topic interface has specific uses of the interface
functions. This code will scale like all get out, too. I hope helps out...
--
Dok
Skyymap Inc.
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Andreas
Rønning
Sent: Wednesday, November 09, 2005 10:30 AM
To: Flashcoders mailing list
Subject: [Flashcoders] AS2 compiler error extravaganza
two classes. First lines of the problem class:
import flash.geom.*;
import as.maps.model.GroupReference;
class as.maps.model.Topic{
...
}
first lines of the GroupReference class
import as.memomaps.model.Topic;
class as.memomaps.model.GroupReference{
...
}
Topic.as: Line 3: The name of this class, 'as.memomaps.model.Topic',
conflicts with the name of another class that was loaded,
'as.memomaps.model.Topic'.
class as.memomaps.model.Topic{
This makes sense. Topic imports groupreference which imports topic. Bad
Andreas.
So how to work around this? I make a completely empty class called
DataSource, and have Topic extend that.
Then in GroupReference, i import as.memomaps.model.DataSource instead, and
have whatever variables were expecting a Topic datatype to expect a
DataSource type.
Whammy. no more errors.
The thing is, it's hard to simplify the Topic class down further: it's got a
very specialized purpose. So is my method acceptable? To me it just looks
terribly dirty.
Any suggestions as to how i can solve this kind of cross-import issue in a
more elegant manner?
- Andreas
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders