| Method | Defined By | ||
|---|---|---|---|
functionToString(func:Function):String [static]
Converts a function to a readable string. | FunctionUtils | ||
| functionToString | () | method |
public static function functionToString(func:Function):StringConverts a function to a readable string. Note: only works in the debug player.
Parameters
func:Function |
String |
This is an example of the FunctionUtils.
This example uses Yalala to log debug information. Go to http://yalala.tyz.nl to view the debug messages.
View this example online at: http://templelibrary.googlecode.com/svn/trunk/examples/temple/utils/types/FunctionUtilsExample.swf
package
{
import temple.utils.types.FunctionUtils;
import flash.display.MovieClip;
// This class extends the DocumentClassExample, which handles some default Temple settings. This class can be found in directory '/examples/templates/'
public class FunctionUtilsExample extends DocumentClassExample
{
public function FunctionUtilsExample()
{
// The super class connects to Yalog, so you can see all log message at: http://yalala.tyz.nl/
super("Temple - FunctionUtilsExample");
log(myPrivateFunction); // function Function() {}
// private function
log(FunctionUtils.functionToString(myPrivateFunction)); // FunctionUtilsExample.myPrivateFunction()
// static function
log(FunctionUtils.functionToString(FunctionUtils.functionToString)); // FunctionUtils.functionToString()
// method
log(FunctionUtils.functionToString(new MovieClip().gotoAndPlay)); // MovieClip.gotoAndPlay()
}
private function myPrivateFunction():void
{
}
}
}