Created
October 27, 2011 08:24
-
-
Save robertpenner/1319052 to your computer and use it in GitHub Desktop.
trying to get function signature
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected function listenerValid(listener:Function):Boolean | |
{ | |
var scope:Array = getLexicalScopes(listener); | |
var scopeXML:XML = flash.utils.describeType(scope[0]); | |
// No clue on how to get the "name" of the function passed. I had to use a hard coded string of "hearSignal" for this test | |
var functionDescriptionXML:XML = scopeXML.factory.method.(@name == "hearSignal")[0]; | |
var params:XMLList = functionDescriptionXML..parameter; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
if the Function-instance is from a public property or mehtod af an instance you have access to, I think you could iterate over the list of methods/properties and test if
listener == instance[method.@name](This could maybe work without reflection, if the method is a public and enumerable property of the class.)
I don't think the is another option other then using bytecode-based reflection...