Adobe Flex 3 Help

Viewing errors and warnings

You can use the compiler options to specify what level of warnings and errors to view. Also, you can set levels of logging with the compiler options.

Viewing warnings and errors

There are several options that let you customize the level of warnings and errors that are displayed by the Flex compilers, including the following:

  • show-binding-warnings
  • show-actionscript-warnings
  • show-shadowed-device-font-warnings
  • strict
  • warnings

To disable all warnings, set the warnings option to false.

The show-actionscript-warnings option displays compiler warnings for the following situations:

  1. Situations that are probably not what the developer intended, but are still legal; for example:
    if (a = 10)                             // Did you really want '==' instead of '='?
    if (b == NaN)                             // Any comparison with NaN is always false.
    var b;                            // Missing type declaration.
    
    
  • Usage of deprecated or removed ActionScript 2.0 APIs.
  • Situations where APIs behave differently in ActionScript 2.0 than in ActionScript 3.0.

You can customize the types of warnings displayed by using options that begin with warn (for example, warn-constructor-return-values and warn-bad-type-cast). A complete list of warnings are available in the advanced command-line help or in the flex-config.xml file.

The strict option enforces typing and reports run-time verifier errors at compile time. This option assumes that definitions are not dynamically redefined at run time, so these checks can be made at compile time. It displays errors for conditions such as undefined references, const and private violations, argument mismatches, and type checking.

The show-binding-warnings option displays warnings when Flash Player cannot detect changes to bound properties.

About deprecation

The command-line compilers express deprecation warnings by default. In some cases, Flex functionality has been deprecated. Deprecated features and properties have the following characteristics:

  • Generate compilation warnings that Flex displays in the HTML wrapper for the application.
  • Continue to work in Flex 2 and 2.0.1.
  • Will be removed from the product in a future major release.

You can suppress deprecation warnings by setting the show-deprecated-warnings option to false.

There is a [Deprecated] metadata tag that you can use to deprecate your own classes and class elements. For more information, see Deprecated metadata tag in Creating and Extending Adobe Flex 3 Components.

About logging

Errors and warnings are reported differently, depending on which compiler you are using.

The mxmlc and compc command-line compilers send error and warning messages to the standard output. You can redirect this output by using the redirector (>).

Flex Builder displays error and warning messages in the Problems tab.

The web-tier compiler displays error and warning messages in the requesting browser by default. The web-tier compiler also stores error and warning messages in a log file. For more information on configuring logging for the web-tier compiler, see Using the web-tier compiler log files.