Search code examples
actionscript-3apache-flexflex4

AS3/Flex : Interface extends interface


In AS3/Flex, is it possible for me that one interface extends another interface ?

I have created interface A. Now I want to create another Interface B which extends interface A.

I google a lot but couldnt find any convincing answer. Please help.


Solution

  • Of course you can extend an interface:

    Multiple interfaces can be inherited by another interface through the extends clause or by a class through the implements clause. Instances of a class that implements an interface be long to the type represented by the interface. Interface definitions must only contain function definitions, which may include get and set methods.

    Keep in mind: Sometimes it is faster to just try it out or simply look in the Flex SDK source code. ;-)

    ${FLEX_HOME}\frameworks\projects\framework\src\mx\core\IUIComponent.as:

    package mx.core
    { 
    ...
    public interface IUIComponent extends IFlexDisplayObject
    {
    ...