views:

368

answers:

2

In ActionScript (AS3) how do I find all the classes that implement a particular interface?

A: 

In OOP terms, you never want to be able to do this: the primary characteristic of interfaces is they are terms of a contract. Any class can choose to fulfill that contract and be able to say "I implement this interface".

Any code that references an instance of the interface don't care what class actually implements it: they don't have to; that's the really cool part of interfaces.

But if you want to find out, grep for "implements IFred"

Cheers

Richard Haven
A: 

I've figured out how to do this and posted a demo on my blog. It uses the getDefinitionNames library mentioned in the comments above.

James Ward