Hi Jaime,

Thank you for your answer, and yes, you are right, there's a little mistake on 
the code (I wrote it without testing... my bad).

However, the error is still there: "Ambigous reference to data". Any ideas?

Bruno Leite

--- In [email protected], Jamie S <jsjph...@...> wrote:
>
> Shouldn't it be:
> 
> public function set data(value:*):void
> {
> _data = value;
> }
> 
> Jamie
> 
> On Fri, Jan 8, 2010 at 5:58 AM, 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
> >
> >  
> >
>


Reply via email to