numerical25
numerical25

Reputation: 10790

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);
            addChild(game);
        }

    }
}

Upvotes: 2

Views: 11954

Answers (7)

Tom
Tom

Reputation: 11

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

Upvotes: 1

Sarthak Salunke
Sarthak Salunke

Reputation: 65

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

Upvotes: 0

Austech
Austech

Reputation: 1

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!

Upvotes: 0

felwithe
felwithe

Reputation: 2744

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.

Upvotes: 6

Nexim
Nexim

Reputation: 54

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.

Upvotes: 1

Tom
Tom

Reputation: 12659

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

Upvotes: 7

back2dos
back2dos

Reputation: 15623

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)

Upvotes: 1

Related Questions