flex trace panel----flex调试信息显示工具

本文介绍了一款由Macromedia提供的Flex调试工具FlexTracePanel,该工具能够帮助开发者轻松打印详细信息并按级别筛选错误、警告及普通信息。通过简单的API调用即可实现对任意类型对象的调试。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

flex的调试,困难我想用过的人都有所了解的,就算用里面的show或是拿一个textArea来显示,也不一定可以显示出完整的信息,就简单的Object对象也是直接显示Object,至于里面的细节难得追究。

而MM自己提供的一个工具----flex trace panel

可以说大大的方便了调试,打印详细信息,还可以只显示自己需要的出错,警告,信息等不同级别信息。

可在网上找了很久,没有找到相关的中文说明,找了个英文,使用的方法也很简单的,顺便用中文简单的描述下:

将下载的包解压后放工程一个目录

假设路径:de\richinternet.\utils\Dumper.as

那么,你可以打开Dumper.as类里面的函数看看,很简单的五个函数:

de.richinternet.utils.Dumper.dump(message:Object, level:Number):Void --------------这个函数的功能是可以打印调试信息,提供的参数是一个对象(只要Object继承来的都可以,也就是任意类型啦,哈哈),第二个参数是一个信息级别。一般只要提供一个对象,啥信息都给你打出来。很详细哦。基本上调试用这个就够了哦。
takes the passed Object (any type) and routes it to the Flex Trace Panel, the 2nd paramter is optional and refers to the different log levels of the Dumper class (the default is Dumper.INFO) de.richinternet.utils.Dumper.trace(message:Object):Void --------------------这个函数没啥意思,就打印调试信息,说实话,一点用都没。
takes the passed Object (any type) calls the Dump.dump() method with log level Dumper.INFO (2). de.richinternet.utils.Dumper.info(message:Object):Void -----------------这个也是破函数。打印信息的
takes the passed Object (any type) calls the Dump.dump() method with log level Dumper.INFO (2). de.richinternet.utils.Dumper.warn(message:Object):Void ---------------这个还马马虎虎,打印警告信息
takes the passed Object (any type) calls the Dump.dump() method with log level Dumper.WARN (4). de.richinternet.utils.Dumper.error(message:Object):Void -------------------这个嘛,嘿嘿,它打印了你就惨了,打印错误信息,你的对象出错了,它就打。
takes the passed Object (any type) calls the Dump.dump() method with log level Dumper.ERROR (8).

呵呵

就这么几个简单的函数,但我还是写详细点吧,对大家有用的是下面哦(注意看):

在ActionScript里面,随便哪个地方调用这个(当然要保证我们打的对象testResult存在的,起码前面定义了的,不然就没意义了):

import de.richinternet.utils.Dumper;

de.richinternet.utils.Dumper.dump(testResult);

显示的就下面类似信息:

哈哈,其实说这么多,就上面两句和下面的地址有用

别打我哦

下载地址:http://www.macromedia.com/devnet/flex/articles/tracepanel.html

欢迎常来冰树之家

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值