I'm certainly no expert but as I understand it, an interface is a class that
is only good for inheriting, never instantiating.
For example - if you were going to write two classes - Baseball and
Softball, you would want a parent class Ball. However, you won't ever
instantiate a Ball, you'll always use one of the subclasses. Furthermore,
Baseball and Softball both have similar properties (pitch, circumference,
weight, etc) but those functions are implemented differently between the
two. So instead of making a Ball class and overriding all the methods both
times, you would make an Interface that they both implement. You haven't
written any code in the interface, just defined that all Ball objects will
have a pitch method, and a circumference and weight, and the implementation
is up to them.

So that's all well and good but the real power is that you can use Ball as a
data type later to refer to either type: myBall:Ball = new Softball().

I hope that helps -


On Mon, Aug 25, 2008 at 3:39 PM, Omar Fouad <[EMAIL PROTECTED]> wrote:

> This could seem weird...
> But what the hell is an interface!!!???????? I've read lots of books and
> posts without getting the answer. I bought "Essential AS3" to read about
> interfaces and he says that helps for multi inheritance. In other places I
> read that it is a "deal" to ensure that a class has some methods and so on.
> But what is the real benefit that I can come out with using interfaces????
>
> Maybe that is stupidity or I am not smart enough to get the concept but
> believe me... its is been two years now!!
>
> Please Help!!!
>
> --
> Omar M. Fouad - Digital Emotions
> http://www.omarfouad.net
>
> This e-mail and any attachment is for authorised use by the intended
> recipient(s) only. It may contain proprietary material, confidential
> information and/or be subject to legal privilege. It should not be copied,
> disclosed to, retained or used by, any other party. If you are not an
> intended recipient then please promptly delete this e-mail and any
> attachment and all copies and inform the sender. Thank you.
> _______________________________________________
> Flashcoders mailing list
> Flashcoders@chattyfig.figleaf.com
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to