Check to see if a class has a method

numerical25 picture numerical25 · Jan 31, 2010 · Viewed 8k times · Source

Is it possible to check a class to see whether it has a method or not ? Or even a particular property

Answer

a_w picture a_w · Jan 31, 2010
var target:Object;// = some object
var name:String;// = some name
if(name in target){
    // if property/method exists
}else{
    // if property/method not exists
}