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.
 
>From what I can remember from Java (which I admit, seems ages ago ;)), this
first should be no problem at all.
 
Does anyone know why this is not allowed in Flash?
 
thanks in advance.
Hans
 
 
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to