Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7368463
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T03:40:50+00:00 2026-05-29T03:40:50+00:00

Multiple Inheritance in ActionScript 3? Is it possible? I have read somewhere that it

  • 0

Multiple Inheritance in ActionScript 3? Is it possible? I have read somewhere that it is possible in as3.

If yes then how?

this is my Doucument Class A.as

package
{
    import flash.display.MovieClip;

    public class A extends MovieClip implements B
    {    
        public var value1:Number=10;

        public function A()
        {
            trace("A Class Constructor");
        }
        public function hit():void
        {
            trace(value1+' from hit');   
        }
    }
}

Another is interface B.as

    package
    {
       public interface B
       {
          trace(' interface ');
          function hit():void;
       }
    }

Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T03:40:51+00:00Added an answer on May 29, 2026 at 3:40 am

    Multiple inheritance is not possible in AS. But with interfaces you can mimic some of the functionality of multiple inheritance. MI has major flaws, most notably the diamond problem:
    http://en.wikipedia.org/wiki/Diamond_problem
    That’s why many languages don’t support MI, but only single inheritance.
    Using interfaces it “appears” you apply MI, but in reality that is not the case since interfaces don’t provide an implementation, but only a promise of functionality.

    interface BadAss{
        function doSomethingBadAss():void;
    }
    
    interface Preacher{
        function quoteBible():void;
    }
    
    class CrazyGangsta implements BadAss, Preacher{
        function quoteBible():void{
            trace( "The path of the righteous man is beset on all sides by the inequities of the selfish and the tyranny of evil men." );
        }
        function doSomethingBadAss():void{
            //do something badass
        }
    }
    
    var julesWinnfield : CrazyGangsta = new CrazyGangsta();
    julesWinnfield.doSomethingBadAss();
    julesWinnfield.quoteBible();
    
    //however, it mimics MI, since you can do:
    
    var mofo : BadAss = julesWinnfield;
    mofo.doSomethingBadAss();
    //but not mofo.quoteBible();
    
    var holyMan : Preacher = julesWinnfield;
    holyMan.quoteBible();
    //but not holyMan.doSomethingBadAss();
    

    P.S.: In case you’d wonder:
    There’s no diamond problem with interfaces since an implementor of the interfaces must provide exactly one implementation of each member defined in the interfaces. So, even if both interfaces would define the same member (with identical signature of course) there will still be only one implementation.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have multiple inheritance like this one: Can I extend a class using more
Possible Duplicate: Can Super deal with multiple inheritance? Python inheritance? I have a class
Do you consider .NET to have multiple inheritance? Why? Yes, I know that by
I am aware that Java doesn't support multiple inheritance. But if I have to
Is it possible to have multiple inheritance in XML schemas, if so how? Example
In multiple inheritance c++ with same attribute in suber class like this code class
If C++.NET allowed multiple inheritance, I would have my common methods in a class
Possible Duplicates: C++ pointer multi-inheritance fun. more c++ multiple inheritance fun This is a
We all know why Java does/should not have multiple inheritance. So this is not
I have been working on a multiple inheritance code which looks similar to this:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.