Re: [Flashcoders] interfaces and objects

2006-02-01 Thread Ian Thomas
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.

Re: [Flashcoders] interfaces and objects

2006-02-01 Thread Julien Vignali
Well, you can't instanciate an interface, you need first a concrete class that implements the interface... Your code should be: interface IWorldPart {} class SomeWorldPartSubclass implements IWorldPart {} var myPart:SomeWorldPartSubclass = new SomeWorldPartSubclass();

Re: [Flashcoders] interfaces and objects

2006-02-01 Thread Steve Webster
Well, you can't instanciate an interface, you need first a concrete class that implements the interface... While you cannot instantiate an interface, you can assign an object that is an instance of a class that does implement the interface to a variable that is typed to the interface.

Re: [Flashcoders] interfaces and objects

2006-02-01 Thread Ian Thomas
No, you can't instantiate an interface. But I don't think Hans was doing that. There's no problem with typing: interface IWorldPart {} class SomeWorldPartSubclass implements IWorldPart {} var myPart:IWorldPart = new SomeWorldPartSubclass(); /* Note INTERFACE-typed var, not concrete */

RE: [Flashcoders] interfaces and objects

2006-02-01 Thread j.c.wichman
SomeWorldPartSubclass();) by the way. Thanks for your comments, H -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Ian Thomas Sent: Wednesday, February 01, 2006 12:36 PM To: Flashcoders mailing list Subject: Re: [Flashcoders] interfaces and objects Um... not quite

RE: [Flashcoders] interfaces and objects

2006-02-01 Thread j.c.wichman
H -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Julien Vignali Sent: Wednesday, February 01, 2006 12:49 PM To: Flashcoders mailing list Subject: Re: [Flashcoders] interfaces and objects Well, you can't instanciate an interface, you need first

Re: [Flashcoders] interfaces and objects

2006-02-01 Thread Ian Thomas
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

RE: [Flashcoders] interfaces and objects

2006-02-01 Thread j.c.wichman
] [mailto:[EMAIL PROTECTED] On Behalf Of Ian Thomas Sent: Wednesday, February 01, 2006 1:05 PM To: Flashcoders mailing list Subject: Re: [Flashcoders] interfaces and objects No, you can't instantiate an interface. But I don't think Hans was doing that. There's no problem with typing: interface

Re: [Flashcoders] interfaces and objects

2006-02-01 Thread Ian Thomas
But it should. :-) Like I said, my quick test of var myPart:SomeInterface=new SomeConcreteImplementingSomeInterface(); trace(myPart instanceof Object); Traces 'true'. Which is what I'd expect. I really don't understand why you're getting an error with myCollection. I know you've solved your

Re: [Flashcoders] interfaces and objects

2006-02-01 Thread Julien Vignali
is not regarded by flash then of being of type Object as well. Got it figured out now ;) Thanks H -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Julien Vignali Sent: Wednesday, February 01, 2006 12:49 PM To: Flashcoders mailing list Subject: Re: [Flashcoders

RE: [Flashcoders] interfaces and objects

2006-02-01 Thread j.c.wichman
mailing list Subject: Re: [Flashcoders] interfaces and objects But it should. :-) Like I said, my quick test of var myPart:SomeInterface=new SomeConcreteImplementingSomeInterface(); trace(myPart instanceof Object); Traces 'true'. Which is what I'd expect. I really don't understand why you're getting

RE: [Flashcoders] interfaces and objects

2006-02-01 Thread j.c.wichman
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

Re: [Flashcoders] interfaces and objects

2006-02-01 Thread Ian Thomas
MX2004 Cheers, Ian On 2/1/06, j.c.wichman [EMAIL PROTECTED] wrote: Hi Ian, Which flash version are you using? I had other problems yesterday with extending CollectionImpl due to my flash version (mx 2004), which worked just fine in flash 8. Might be the same in this case. Are you

Re: [Flashcoders] interfaces and objects

2006-02-01 Thread Ian Thomas
'Fraid not. One to chalk down to experience, I guess. Oh well. I'm making the move to 8 shortly myself, once this latest crop of projects are out of the way... Ian On 2/1/06, j.c.wichman [EMAIL PROTECTED] wrote: Life is so unfair :) I had to switch to flash 8 to make it go away... My mind