views:

53

answers:

1

I am trying to create an ActionScript 3 class that implements two interfaces. The interfaces contain member functions with different signatures but the same name:

public interface IFoo
{
    function doStuff(input:int):void;
}

public interface IBar
{
    function doStuff(input1:String, input2:Number):void;
}

public class FooBar implements IFoo, IBar
{
    // ???
}

In C# (for example) this is not a problem because methods can be overloaded, but ActionScript does not support overloading. Is there any way to create a class that implements both interfaces?

+1  A: 

public class FooBar would have to implement both interaces and thus implment those functions listed. Problem is ActionScript does not support method overloading. It is a nice feature that I miss from C# :(

Allan
You're right; explicit interface implementations aren't even necessary in C# to solve this problem; simple method overloading will do. I updated the question to reflect this. However, the question was "Is there any way to create a class that implements both interfaces?" so your answer isn't really an answer.
Aaron