Trace() 方法在 FlashDevelop 中不起作用

发布于 2024-08-28 01:45:11 字数 704 浏览 13 评论 0原文

当我放置跟踪(“测试”)时;在我的 flashdevelop 项目的入口点并运行它。该应用程序运行良好,但我在输出中没有看到跟踪。下面是我的代码

package 
{
    import flash.display.Sprite;
    import flash.events.Event;

    /**
     * ...
     * @author Anthony Gordon
     */
    public class Main extends Sprite 
    {

        public function Main():void 
        {
            if (stage) init();
            else addEventListener(Event.ADDED_TO_STAGE, init);
        }

        private function init(e:Event = null):void 
        {
            trace("test");
            removeEventListener(Event.ADDED_TO_STAGE, init);
            // entry point
            var game:Game = new Game(stage);
            addChild(game);
        }

    }
}

When I put a trace("test"); at the entry point of my flashdevelop project and run it. The application runs fine but I do not see the trace in the output. Below is my code

package 
{
    import flash.display.Sprite;
    import flash.events.Event;

    /**
     * ...
     * @author Anthony Gordon
     */
    public class Main extends Sprite 
    {

        public function Main():void 
        {
            if (stage) init();
            else addEventListener(Event.ADDED_TO_STAGE, init);
        }

        private function init(e:Event = null):void 
        {
            trace("test");
            removeEventListener(Event.ADDED_TO_STAGE, init);
            // entry point
            var game:Game = new Game(stage);
            addChild(game);
        }

    }
}

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(7

无悔心 2024-09-04 01:45:11

如果您尝试在闪存开发中查看跟踪,您需要查看“日志”选项卡,然后单击“开始跟踪”,跟踪将显示在日志输出中,而不是输出选项卡中。

http://www.zedia.net/2010/log-trace- log-release-log/

还允许您查看浏览器内运行的 Flash 应用程序的痕迹:)

If your trying to view the traces in flash develop you need to look under the logs tab, and click start tracking, the traces will then appear in the logs output not the output tab.

http://www.zedia.net/2010/log-trace-log-release-log/

Also allows you to see traces from flash apps running inside a browser :)

︶ ̄淡然 2024-09-04 01:45:11

我遇到了这个问题,结果发现我是在Release模式而不是Debug模式下测试项目。如果不在调试模式下,则不会打印跟踪信息。它是“测试项目”按钮右侧的下拉菜单。

I had this problem, and it turned out that I was testing the project in Release mode instead of Debug. If not in Debug mode, it will not print traces. It's the drop-down just to the right of the Test Project button.

嘿哥们儿 2024-09-04 01:45:11

获取 flash 播放器内容调试器。要将 SWF 与独立调试播放器关联,您必须启动它一次。

请注意,调试播放器速度稍慢。如果您在弹出窗口中运行 Flash 应用程序,则需要“独立”播放器;如果您计划在 Web 浏览器中测试 Flash 应用程序,则需要一个或两个插件(一个插件用于 IE,一个插件用于对于所有其他浏览器)

get the flash player content debugger. to associate SWFs with the standalone debug player, you must launch it once.

Please note the debug player is somewhat slower. You need the 'standalone' player if you are running your flash apps in a popup window, or you need one or both of the plugins if you plan to test your flash apps in a web browser (one plugin is for IE, one plugin is for all other browsers)

假扮的天使 2024-09-04 01:45:11

我遇到了这个问题,没有找到好的答案。这是搜索的最高结果,所以我将在这里添加一些信息。

我已经设置了 FlashDevelop 4.0.4 来工作,有正确的 Flex SDK,有调试器。检查了每一个设置,卸载,重新安装,重新启动,以及几乎所有你能想象到的东西。

我最终发现我的应用程序的入口点类实际上并未命名为 Main。事实证明,这导致我的跟踪看起来失败了,因为文档类不会打印跟踪,除非它被命名为 Main。

I had a problem with this, and didn't find a good answer. This was the top result on the search, so I'll drop some info here.

I had set up FlashDevelop 4.0.4 to work, had the right Flex SDK, had the debuggers. checked every setting, uninstalled, reinstalled, rebooted, and just about everything else you could imagine.

I wound up discovering that my application's entry point class was not actually named Main. It turns out, this was causing my traces to seem like they were failing, as the document class won't print traces unless it is named Main.

一念一轮回 2024-09-04 01:45:11

有一天,这件事发生在我身上——完全出乎意料,没有任何原因。我能够使用 Project > 解决问题;属性>编译器选项,然后将“忽略跟踪函数”选项从“true”设置为“false”。

屏幕截图:

点击查看图片

This happened to me one day - completely out of the blue for no reason. I was able to solve the problem using Project > Properties > Compiler Options and then setting the "Omit Trace Functions" option from "true" to "false".

Screenshot:

Click for a picture

绝不放开 2024-09-04 01:45:11

最近遇到这个问题,希望能帮助到有同样问题的人。我假设您正在使用 Flex SDK 并且使用的是 Windows。

正如其他人所说,请确保您在调试模式下进行测试。

如果您像我一样并且这不起作用,请查看 swf 的默认应用程序是否是 Flex 的运行时。 flex_sdk_4.6\runtimes\player\11.1\win\FlashPlayerDebugger.exe

希望有帮助!

Recently had this problem, hope I can help anyone here that had the same issues. I'm going to assume you're using the Flex SDK and are on Windows.

As others have said, make sure you're testing in Debug mode.

If you're like me and that didn't work, see if swf's default application is the flex's runtime. flex_sdk_4.6\runtimes\player\11.1\win\FlashPlayerDebugger.exe

Hope that helps!

‘画卷フ 2024-09-04 01:45:11

将 Java 运行时更新到 1.6 或更高版本
这对我有用

update Java Run Time to 1.6 or higher
It worked for me

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文