Thanks.

Looks ta' worked!

Scott


On 3/29/06, Gordon Smith <[EMAIL PROTECTED]> wrote:

'is' can only be used to test *instances* of classes that implement interfaces. You don't use it with the class itself.

 

So...

 

function checkImp(className:Class):Boolean

{

    return new className() is IMyInterface;

}

 

will work.

 

You could also use describeType(className) and iterate over the <implementsInterface> child tags, but this would be much more expensive.

 

- Gordon

 


From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Scott Langeberg
Sent: Wednesday, March 29, 2006 1:29 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Beta 2: Evaluating interfaces

 

Wondering if there is ability to find out if a Class implements an interface? As in:

function checkImp(className:Class): Boolean {
   return (className is IMyInterface);
}

I'm using the PopUpManager internally, and want to check that whatever gets passed in implements my interface, first.

Thanks,

: : ) Scott



--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com




YAHOO! GROUPS LINKS






--

: : ) Scott


--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com




YAHOO! GROUPS LINKS




Reply via email to