PDA

View Full Version : Can I do a typeof find a custom class?



nburlington
September 25th, 2008, 04:19 PM
I want to trace through all the items on the stage and find every instance of MyCustomClip instances. Can I do that?


if(typeof(clip.getChildAt(i)) == "MyCustomClip"){ do something}

Valaran
September 25th, 2008, 04:36 PM
As far as I'm concerned, typeof is outdated, use the "is" operator instead, and yes, that works on custom classes.


if(myVar is myClass){
//Whatever!
}

sekasi
September 25th, 2008, 06:57 PM
getQualifiedClassName() works as well, if you need the full name.