Alternatively, you can make those properties bindable. This will cause the compiler to automatically generate the corresponding getter and setter and the interface will be implemented.
However, your example will never work as it is. AS3 currently does not allow implementation signatures to differ at all from the interface, even if they are compatible. I'm hoping that will be "fixed" in a future release. Peter On Nov 21, 2007 5:25 PM, Gordon Smith <[EMAIL PROTECTED]> wrote: > > > > > > > > You can't use a var to implement a getter... you have to write a getter. And > it has to have exactly the same signature. > > - Gordon > > ________________________________ > From: [email protected] [mailto:[EMAIL PROTECTED] On > Behalf Of simonjpalmer > Sent: Wednesday, November 21, 2007 2:21 PM > To: [email protected] > Subject: [flexcoders] Interfaces and Implements > > > > > > Hi, I am having a problem with defining and using interfaces on my AS3 > classes. Here's my scenario... > > class A implements IA{} > class B implements IB{} > > class Wrapper implements IWrapper > { > public var a:A; > public var b:B; > } > > interface IWrapper > { > function get a():IA; > function get b():IB; > } > > When I compile this I get an error: > > "Interface method get a in namespace IWrapper is implemented with an > incompatible signature in class Wrapper" > > A implements IA and get a() returns an instance of class A, so why the > error? > > This is making it a bit hard to code against interfaces rather than > concrete classes. > > Any ideas? > >

