Um... not quite sure what you're up to here - but it sounds like you're
getting a bit confused between IWorldPart and WorldPart.

What you need is:
interface IWorldPart
class SomeWorldPartSubclass implements IWorldPart

then
var myPart:IWorldPart = new SomeWorldPartSubclass();

should be fine.

_OR_

interface WorldPart
class SomeWorldPartSubclass implements WorldPart

then
var myPart:WorldPart = new SomeWorldPartSubclass();

Not quite sure why your description mentions both IWorldPart and WorldPart -
unless WorldPart implements IWorldPart..? In which case you're looking for:

interface IWorldPart
class WorldPart implements IWorldPart
class SomeWorldPartSubclass extends WorldPart

then either
var myPart:WorldPart = new SomeWorldPartSubclass();
or
var myPart:IWorldPart = new SomeWorldPartSubclass();

should both work...

HTH,
  Ian


On 2/1/06, j.c.wichman <[EMAIL PROTECTED]> wrote:
>
> Hi,
> i'm using a collection, which requires items of type Object to be added.
>
> I've declared an interface which gives me something like:
> - interface IWorldPart
> - a class implementing WorldPart
>
> now somewhere else i do:
> var myPart:IWorldPart = new SomeWorldPartSubclass();
> myCollection.addItem (myPart);
>
> The last statement gives a type error, if i replace the first with var
> myPart:WorldPart = new ... all goes well.
>
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to