Re: [Flashcoders] A Question that I've been asking for years!!

2008-08-25 Thread Rob Sampson
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


[Flashcoders] Function => String

2008-08-25 Thread Rob Sampson
I've been working with ExternalInterface.addCallback, and I think it's a
drag that you have to send the name of a function as a String - it seems
like there should be a way to get the name of a function dynamically the
same way Event uses public static constants for their strings – so the
compiler can find my misspellings! It's not a huge problem but (as with
everything in the ExternalInterface) it seems like the implementation wasn't
thought out, and doesn't jive with the rest of the language. So how about it
gurus...any cool toString/prototype/constructor override tricks?
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders