[备忘] 查看浏览器中flash swf的trace调试输出

view flash trace output from browser

这个问题网上已经说得够多, 不过老问题换了新环境, 又有新问题.

在某些情况下, 你必须让swf在浏览器中运行, 同时还想查看用 trace 函数的调试输出.

在网上搜索一下: 你很快就知道两个文件: mm.cfg, flashlog.txt. 以windows 7为例:

C:\Users\username\mm.cfg
C:\Users\username\AppData\Roaming\Macromedia\Flash Player\Logs\flashlog.txt 

基本思路是: 创建或是修改 mm.cfg 文件, 将brower的flash player换成debug版本的, 然后brower中的swf的trace就会在 flashlog.txt文件中.

这篇文章很详细: http://yourpalmark.com/2005/07/01/trace-from-the-browser-using-standard-trace/ , 按步骤分不同的操作系统告诉你应该怎么查看.

实际上, 这并不是什么 hacker 的东东, 因为Adobe官方就有正式的文档: http://kb2.adobe.com/cps/403/kb403009.html

不过上面的两个链接对于 mm.cfg 文件的描述仅仅局限于几个和 trace 相关的, 其实还有很多非常有意思的参数, 你如果你感兴趣, 可以看看这个链接( 文章的评论也很有价值 !) : http://jpauclair.net/2010/02/10/mmcfg-treasure/

有同学嫌这些步骤太麻烦了, 有没有这样的工具可以直接查看? 有!!:  http://code.google.com/p/flash-tracer/

但是, 我发现我的swf文件的trace居然没有输出到flashlog.txt中!

我的环境是Flex SDK 4.5.1, 原来从flex4(flash player 10)开始, compc(和mxmlc) 多了一个编译选项 omit-trace-statements, 见官方文档: http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf69084-7a92.html, 这个选项为 true 的时候, 编译时就会删除trace语句. 我猜测(官方文档没有说), 这个option在compiler.debug==true时, 应该编译时会再强制改为 false).

按文档中说, 这个 omit-trace-statements 默认是 false, 也就是说, trace默认情况下应该是有输出的呀!!

原来问题是出在了 flex-config.xml,  它将这个参数设置成了 true,  而用Ant编译时, 每次compc(mxmlc)都会自动调用这个配置文件.

于是我就改我的Ant XML, 在mxmlc 中加上 <omit-trace-statements>true</omit-trace-statements>, 可是居然报错!! 看样子 flex ant task jar 没有更新到位!!

没办法了, 我只有copy一个 flex-config.xml 出来, 改! 然后ant mxmlc load-config时 用我自己改过的 flex-config.xml了.

最后, 有同学还遇到了问题, 原来, 自定义函数中不能有 trace , 否则mxmlc后trace行为就不对! 你就全当 trace 是一个关键字吧!! 原文: http://stopcoding.wordpress.com/2010/04/21/how-omit-trace-statements-works-or-does-not/

smithfox | Wednesday 10 August 2011 at 4:31 pm | | UI        | Used tags: , , , , , , , , ,

seven comments

smithfox

http://help.adobe.com/en_US/flex/using/W..

smithfox, (URL) - 10-08-’11 17:50
金林水土

给力啊,总算可以在浏览器里面运行并且看输出了

金林水土, (URL) - 16-08-’12 12:09
Chanel iPhone 6 Plus Cases

The iPad Mini 3 measures 7.87-inches tall, 5.3-inches across and is 7.2mm (0.28-inch) thick. The full metal shell of the iPad provides the utmost in strength. It takes a fair amount of pressure to make it bend, but forgive us for not pushing it too far.

Chanel iPhone 6 Plus Cases, (URL) - 20-04-’15 18:24
Dior iPhone 6 Plus Cases

Although the HTC One M9 packs enough metal in its build to impress a medieval knight, this fact of considerable premium-ness doesn’t make HTC’s hero phone any less susceptible to the impact of daily grind.

Dior iPhone 6 Plus Cases, (URL) - 18-06-’15 16:32
entretien ménager Brossard

What’s up, of course this post is actually pleasant and I have
learned lot of things from it about blogging.
thanks.

entretien ménager Brossard, (URL) - 12-03-’18 17:05
wells fargo identity theft login

hey there and thank you for your information – I’ve definitely picked up anything new from
right here. I did however expertise some technical issues using this website, as
I experienced to reload the site lots of times previous to I could get it to load properly.
I had been wondering if your hosting is OK? Not that I’m
complaining, but sluggish loading instances times will often affect your
placement in google and could damage your high quality score
if advertising and marketing with Adwords. Well I am adding this RSS
to my e-mail and can look out for much more of your respective intriguing content.
Make sure you update this again soon.

wells fargo identity theft login, (URL) - 17-03-’18 10:49
paypal login my account

On the following page, choose the area nearest where you live.
Paypal no interest paypal login my account paypal giveaway Once you have a very Pay – Pal account, it is
possible to invest inside the Pay – Pal Money Market Fund.

paypal login my account, (URL) - 08-04-’18 03:19
(optional field)
(optional field)
为阻止垃圾广告, 请在提交评论前, 回答一个简单问题(Please answer an simple question)
Remember personal info?
Notify
Small print: All html tags except <b> and <i> will be removed from your comment. You can make links by just typing the url or mail-address.