Shouldn't it be... var impl1:ImplementationClass = new ImplementationClass(); var implA:InterfaceA = InterfaceA(impl1);
impl1.data = "Something"; trace(implA.data); --- In [email protected], "bmsleite" <bmsle...@...> wrote: > > Hi everyone, > > I hope you guys can help me out with this doubt regarding interfaces that extends from other interfaces. > > The scenario is the following: > > ImplementationClass -implements-> InterfaceB -extends-> InterfaceA > > A code example: > > public interface InterfaceA > { > function get data():*; > } > > > public interface InterfaceB extends InterfaceA > { > function set data(value:*):void; > } > > > public class ImplementationClass implements InterfaceB > { > private var _data:*; > > public function Implementation(){} > > public function set data(value:*):void > { > _data = data; > } > > public function get data():* > { > return _data; > } > > } > > Now, the question is, is this possible? If I write something like this: > > var impl:InterfaceB = new ImplementationClass(); > impl.data = "something"; > > Should this be possible? Well, possible I know that it isn't because this gives me an "Ambigous reference to data" error, but isn't this a logical implementation, am I missing something here? > > Probably the cause for this behaviour has to do with the way that getters and setters are implemented in AS3, if that's the case, can anyone explain me, or give me some ideas how this works internally? > > Thank you for your time. > > Bruno Leite >

