`
javasogo
  • 浏览: 1778489 次
  • 性别: Icon_minigender_1
  • 来自: 北京
文章分类
社区版块
存档分类
最新评论

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

阅读更多

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

    欢迎常来冰树之家

    分享到:
    评论

    相关推荐

    Global site tag (gtag.js) - Google Analytics