开发者

Trace() method doesnt work in FlashDevelop

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);
     开发者_JS百科       addChild(game);
        }

    }
}


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 :)


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.


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)


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.


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:

Trace() method doesnt work in FlashDevelop


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!


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜