Actionscript debug tips: who called my actionscript method?
来源:互联网 发布:mac 射手 字幕位置 编辑:程序博客网 时间:2024/06/05 20:06
转自:http://blog.comtaste.com/2008/11/how_to_know_who_called_my_acti.html
Agood debug tip when you program in actionscript is to know who and whenhas called your method. This can be done by generating an error usingthe "throw new Error()" command inside the traced method. Through acustom error exception we can trace the stack and see the iter of theentire process.
So let's create the method that will invoke the tracing method of the stack:
private function methodToCall() : void
{
calledMethod();
}
Now we have to create the method that trace the stack
private function calledMethod() : void
{
try
{
throw new Error( "my error" );
}
catch ( e:Error )
{
trace( e.getStackTrace() );
}
}
This will be the result, showing the invocation path:
Error: my error
at myproject/calledMethod()[G:/yourpath.mxml:18]
at myprojec/methodToCall()[G:/yourpath.mxml:11]
at myprojec/Button1_click()[G:/yourpath.mxml:4]
For further reference, please consult the documentation of the Error class, on the Adobe site:
LiveDocs Error Class
- Actionscript debug tips: who called my actionscript method?
- ActionScript
- actionscript
- actionscript
- Tips for learning ActionScript 3.0
- ActionScript 基础
- ActionScript 3
- ActionScript 3.0
- ActionScript 介绍
- 1.4 ActionScript
- [ActionScript]数组
- ActionScript 学习
- ActionScript教程
- ActionScript 性能
- ActionScript编译器
- ActionScript是什么
- ActionScript特点
- ActionScript 标签
- 符号计算软件maxima
- void 用途4
- SQL注入
- SQL 字段为NULL查询
- 连接池 ConnectionPooling
- Actionscript debug tips: who called my actionscript method?
- 马云,你也需要帮助
- ExtJs gridpanel 中的按钮列
- LoadRunner学习系列——Analysis图分类说明
- [转]如何在 SQL Server 2005 中为安装程序增加计数器注册表项值
- 紀念5.12一周年
- 网编经验分享:网络直播注意事项
- Warning:AS3中图片的最大长宽为2880像素
- NFS mount配置