2

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); } } } 
3
  • I'm pretty sure the call to removeEventListener will fail if the event listener was never added (in the else of Main). Also, make sure (using a breakpoint) that init is being called in the first place. If it isn't, I have a suspicion the document class is not added to the stage. But I could be wrong! Commented Apr 3, 2010 at 5:08
  • @Cameron: no, sorry. that's wrong. look in the language reference. you'll also discover, there's no way to find out whether a handler is already registered to a dispatcher, thus such behaviour would really be a great flaw. Commented Apr 3, 2010 at 17:19
  • @back2dos: You're right! There's hasEventListener, but it only checks for the event type without the specific callback. Commented Apr 3, 2010 at 19:24

7 Answers 7

7

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

Sign up to request clarification or add additional context in comments.

3 Comments

look under the logs tab, and click start tracking Works great... This took me days to figure out.
make sure your in 'debug' not 'release' mode too (dropdown on toolbar)
I've gone a couple of years without, until I saw your answer.
6

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.

Comments

1

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)

Comments

1

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.

Comments

1

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

Comments

0

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!

Comments

0

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

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.