views:

1457

answers:

4

Hello,

I am trying to output my Flash application's trace to the firebug console. After some Goggling I have found that other are doing something like this:

public static function debug(text: Dynamic):Void {
            trace(text);
            ExternalInterface.call("console.log", text.toString());
    }

My Firebug console never outputs anything and always just shows "Please Reload Page to enable..."

So, of coarse, I have reloaded the page and it does not seem to change anything. I have the correct Object imported into the calling class. I am running FireBug 1.4.2.

Can someone tell me how to implement this?

Thanks!

-Nick

A: 

I've seen this happening and somehow has to do with Firebug "stuck" in another Firefox window. I'm not sure why, but close all other windows and tabs, then open Firebug, then your application, that's how it works for me.

Try this, your code seems fine. I think it's a Firebug issue.

Zárate
Thanks.. this doesn't seem to be the problem in my case however. The console will actually begin to work on other pages. Here, for example, it works.
Nick
A: 

Replace the console.log with an alert and see if it still fires in your browser. Could be an error somewhere that you are over looking as you are expecting the output. Flash has a habit of hidding JS errors and keeping them to itself.

Pete Duncanson
I replaced the "console.log" with "alert". Should I have seen a JavaScript messagebox?
Nick
Yes you should, if not then theres something a miss with your Flash to JS comms somewhere. One thing to check is don't try talking to the flash movie until its loaded or your browser can goose. Have you tried running it from within the flash authoring prog, sometimes get nice trace feedback in there telling you the problem.
Pete Duncanson
+1  A: 

Hi,

I used Firebug quite a lot with Flex 3 applications. To combine those two tools I used 3rd party OS lib called Flash Thunderbolt. Project home page: http://code.google.com/p/flash-thunderbolt/

Your code looks fine however I didn't make an effort to paste run it by myself, Sorry ;) Anyway don't reinvent the weel just use ready tools. You can always have a look at thier code to learn how they solved that issue.

Cheers, Chris

Chris Ciesielski
A: 

You most likely want FlashBug.

LiraNuna