Custom metadata in Actionscript classes are very cool. You can put anything in square brackets in front of classes, functions, and variables; tell the compiler to include it (by name) in the SWF; and use describeType() to retrieve it.
[MyMetaData(name1=value1, name2=value2)]
Add to "Additional compiler arguments”
-keep-as3-metadata+=MyMetaData
And use describeType() to find those items with that meta-data
var typeDescriptionXML : XML = flash.utils.describeType(aType);
var itemsWithMyMetaData : XMLList =
classXML.factory.metadata.(@name == "MyMetaData");
Static functions, on the other hand are rather straight-forward:
public static function myStaticFunction() : Object
{
var result : Object = new Object({name1: "value1", name2: "value2"});
return result;
}
While I would like static functions to be virtual, they do what they are supposed to do.
What advantage does meta-data have over static functions for class level items?