Re: [Flashcoders] Interfaces: what are the advantages?

2006-10-16 Thread Ray Chuan
Hi Ian, an intrinsic is not used only for built-in Flash Player classes/code. You can use it to save yourself some time, since the compiler doesn't compiler the bytecode all again. With intrinsics no bytecode is generated, only type-checking is done. With interfaces bytecode is generated. I'm

Re: [Flashcoders] Interfaces: what are the advantages?

2006-10-16 Thread Ian Thomas
Hi Ray, I know what intrinsics are, what they're _supposed_ to be for, and what they're actually used for. :-) It's a matter of personal preference. I don't use them because, as I said earlier, I can do things in other ways. For the purpose I was talking about - seperating code into different

Re: [Flashcoders] Interfaces: what are the advantages?

2006-10-14 Thread Ray Chuan
Hi, can't this be done with intrinsics? http://livedocs.macromedia.com/flash/8/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Partsfile=1879.html On 10/14/06, Ian Thomas [EMAIL PROTECTED] wrote: On 10/13/06, Jim Kremens [EMAIL PROTECTED] wrote: I understand what interfaces

Re: [Flashcoders] Interfaces: what are the advantages?

2006-10-14 Thread slangeberg
can't this be done with intrinsics? Ray, an interface does not include variables, so this example looks more like an Abstract class. intrinsic class Circle { var radius:Number; function Circle(radius:Number); function getArea():Number; function getDiameter():Number; function

Re: [Flashcoders] Interfaces: what are the advantages?

2006-10-14 Thread Ian Thomas
Hi Ray, Yes - but why would you, if the language spec already supports interfaces? Using interfaces is a much more 'standard' way (i.e. the same sort of thing you'd do if you were talking to dynamic libraries in other languages). I still see intrinsics as a bit of a hack. These classes are

Re: [Flashcoders] Interfaces: what are the advantages?

2006-10-14 Thread Ian Thomas
Scott, To me, an abstract class is one which has a partial - but incomplete - implementation i.e. you should never find yourself writing new SomeAbstractClass() - you should only ever be creating objects derived from it. The abstract class contains some useful re-usable stuff, but can't function

Re: [Flashcoders] Interfaces: what are the advantages?

2006-10-14 Thread slangeberg
Ian, That being the case, I can't quite see how intrinsics apply, as by their nature they include no implementation at all. Ah, good point. I just got excited when I saw that variable in there. It is one step closer to abstract. Oddly, in AS3 Macrodobe have taken out the facility to mark

Re: [Flashcoders] Interfaces: what are the advantages?

2006-10-13 Thread slangeberg
Design principle: 'Code to interface, not implementation'. Say you have classic MusicPlayer interface (and this is all psuedo-code): play() stop() ok, now I've got CDPlayer implements MusicPlayer: play() stop() == nextTrack() and TapePlayer implements MusicPlayer: play() stop() ==

Re: [Flashcoders] Interfaces: what are the advantages?

2006-10-13 Thread Andreas R
Mendelsohn, Michael wrote: Hi list... I understand what interfaces are, but I'm not entirely clear on when they become advantageous to use. Anyone care to shed some light? Thanks, - Michael M. ___ Flashcoders@chattyfig.figleaf.com To change your

Re: [Flashcoders] Interfaces: what are the advantages?

2006-10-13 Thread Jim Kremens
I understand what interfaces are, but I'm not entirely clear on when they become advantageous to use. Anyone care to shed some light? I find them really useful for implementing the strategy pattern, and I find the strategy pattern to be extremely useful in Flash. Let's say, for example, that

Re: [Flashcoders] Interfaces: what are the advantages?

2006-10-13 Thread Ian Thomas
On 10/13/06, Jim Kremens [EMAIL PROTECTED] wrote: I understand what interfaces are, but I'm not entirely clear on when they become advantageous to use. Anyone care to shed some light? Interfaces are also very handy when you want to put the actual implementation code for a class in one .swf,