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
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'
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
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
4 matches
Mail list logo