RE: [flexcoders] How to see if method is implemented in class

2007-09-18 Thread Gordon Smith
if ("validate" in someObject) From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Alex Harui Sent: Tuesday, September 18, 2007 8:10 AM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] How to see if method is implemented in c

RE: [flexcoders] How to see if method is implemented in class

2007-09-18 Thread Alex Harui
If ("validate in someObject) From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of j_lentzz Sent: Tuesday, September 18, 2007 7:26 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] How to see if method is implemented in class Hi, I'

Re: [flexcoders] How to see if method is implemented in class

2007-09-18 Thread Michael Schmalle
Hi, Put your calling code in a try{} catch{} block, then you will not get the RTE. try { someObject.validate(); } catche (e:Error) { trace(someObject.className, "Has no validate() method"); } There are a couple other ways but, this is pretty clean and gets the job done. Peace, Mike On 9

RE: [flexcoders] How to see if method is implemented in class

2007-09-18 Thread Mike Krotscheck
You could have your custom components implement a custom interface like IValidatable that requires the validate() function, and then check whether the class implements that interface by using the following: if( yourComponent is IValidatable) { // Your code here } Michael Krot