Hi, Yes steve was completely right about that. Thanks all! H
-----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Ian Thomas Sent: Wednesday, February 01, 2006 1:19 PM To: Flashcoders mailing list Subject: Re: [Flashcoders] interfaces and objects Then as Steve says, sounds like a compiler bug. Ian On 2/1/06, j.c.wichman <[EMAIL PROTECTED]> wrote: > > Hi, > No confusion here ;) except maybe for my fuzzy explanation ;). > I did: > interface IWorldPart > class WorldPart implements IWorldPart > class SomeWorldPartSubclass extends WorldPart > > then either > var myPart:WorldPart = new SomeWorldPartSubclass(); or var > myPart:IWorldPart = new SomeWorldPartSubclass(); > > As you described, however collection.addItem (myPart) only works in > the first case and not in the second. > Probably becoz flash thinks IWorldPart is not an object. I changed it to : > var myPart:Object = new SomeWorldPartSubclass(); And it works fine > (just as var myPart:WorldPart = new > SomeWorldPartSubclass();) by the way. > > Thanks for your comments, > H > _______________________________________________ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders _______________________________________________ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders