将 Flash 输出窗口数据显示到文本字段中
是否可以将输出窗口的内容显示到文本字段中,以便可以在 SWF 中看到?
有人试过这个吗?
is it possible to display the output window's contents into a textField so it can be seen in the SWF?
Has anyone tried this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您需要实现一个自定义解决方案,基本上每次调用trace()时,都调用一个自定义方法,该方法也将其放入您的文本字段中。如果实现是静态的,那么它将是全局可访问的。
网络上有很多实现可以帮助您完成大部分工作,只需谷歌“Logging”“Logger”或类似的东西即可。我什至在我的网站上也有一个。 http://tyleregeto.com/code/logger/
You'll need to implement a custom solution, basically every time you would call trace(), call a custom method that also put's it into your text field. If the implementation was static, it would be globally accessible.
There will be many implementations on the web that will get you most of the way there, just Google "Logging" "Logger" or something along those lines. I've got one on my site even. http://tyleregeto.com/code/logger/
有多种方法可以做到这一点。一种方法是使用泰勒提到的记录器。我是 XRay 的忠实粉丝。它很容易设置/使用,而且非常非常强大。不仅可以获取输出,还可以进行实时闪光操作。
定义一个名为 Logger 的单例类。
There are a number of ways to do this. One method would be to use the logger Tyler mentioned. I am a big fan of XRay. It is easy to set up / use and is very, very powerful. Not only to get output, but also for realtime flash manipulation.
Define a singleton class called Logger.