Advertisement
sanych_dv

AS3 Function reference

Jan 10th, 2015
332
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     import flash.sampler.getSavedThis;
  2.     import flash.utils.describeType;
  3.  
  4. static public function getReference(f:Function):String
  5.         {
  6.            
  7.             var t:Object = getSavedThis(f);
  8.            
  9.             var methods:XMLList = describeType(t)..method.@name;
  10.             for each (var m:String in methods)
  11.             {
  12.                
  13.                 if (t.hasOwnProperty(m) && t[m] != null && t[m] === f)
  14.                     return t.toString() + "::" + m;
  15.             }
  16.             return null;
  17.        
  18.         }
  19.  
  20. // only public functions
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement