If I'm not mistaken - JSFL, like most JavaScript implementations, is a prototype language. This means that you can add new properties / methods to existing built-in objects. Theoretically, it would be possible for all library elements to have a getShortName () method that does the same as the @Justin Putney solution.
Something along the lines of:
Object.prototype.addMethod = function(name, pMethod) { this.prototype[name] = pMethod; } Function.prototype.addMethod = function(name, pMethod) { this.prototype[name] = pMethod; } Object.addMethod( "getShortName", function() { return this.name.split("/").pop(); }); fl.trace( fl.getDocumentDOM().library.items[0].getShortName() );
This makes it a convenient convenient way to extend functionality in JSFL as a whole. Ideally, you just want to run the first bit of this ONCE (method definition) snippet, as they will persist until the Flash IDE runs.
source share