views:

535

answers:

3

Hey everybody

I am trying to use trace() in flash builder 4 - but it doesn't work!

I am running in "debug", also I added to the flex compiler options the "-debug=true" option. What am I doing wrong ???

Thanks!

A: 

Not an answer but I also experienced this ... my project contained a swc flexComponentBase library exported from flash ... after I removed all references to that in my code, the trace fired up again. Also the permit debugging option in flash>publish was activated...

Rebuilding my component in flash and re-converting to flex component again - now trace is working -- weirdness...

jp77sa
A: 

I have an actionscript 3 project in flash builder 4. I am facing the same problem. Trace statements are not showing up in the console !! any idea how to enable them ??

A: 

In flex 4, a new compiler option is added.

-compiler.omit-trace-statements

the default value is set to true. this mode omits trace statements for -debug=false mode and enable trace for -debug=true mode automatically.

BUT there is a bug in fcsh.

If you compile the swf with -debug=true after once compiled it for -debug=true mode, trace statements are still omitted.

If you reboot fcsh, the trace is enabled.

To avoid this, you can disable omit-trace-statements by setting flex-config.

Test.as

package {
    import flash.display.Sprite;

    public class Test extends Sprite {
        public function Test() {
            trace("trace omitted?!");
        }
    }
}

Test-config.xml

<flex-config>
  <compiler>
    <debug>false</debug>
    <omit-trace-statements>true</omit-trace-statements>
  </compiler>
</flex-config>
9re