In Flex, say I have a Class object. How do I get a string for the class it represents?
e.g.:
var clazz:Class= String;
trace(clazz); // this gives "[class String]" but what I want is "String"
In Flex, say I have a Class object. How do I get a string for the class it represents?
e.g.:
var clazz:Class= String;
trace(clazz); // this gives "[class String]" but what I want is "String"
If you want to know all there is about a class, use describeType. Related, you might find useful getDefinition and getDefinitionByName.
describeType return all the details in an XML object. If you're looking just for the name, try something like:
trace(describeType(String).@name);
This is general actionscript. It has no dependency on the flex framework. Goodluck.
flash.utils::getQualifiedClassName
is the function you are looking for ... ;)
Hello,
if(clazz.hasProperty('className'))
{
trace(clazz['className']);
}
Adrian, http://blog.timeister.com/