User Guide

84 Chapter 3: Creating, Coding, and Debugging Flex Files
Validating MXML
Flex Builder can validate MXML and display syntax errors or warnings.
Flex Builder automatically validates an MXML file when you perform an action that synchronizes
the file, such as switching to Design view, previewing the file, or switching to debug mode. Flex
Builder displays any validation errors or warnings in the Validation panel in the Results panel
group. You can also validate a file at any time.
To validate a file, do one of the following:
Press Shift+F6.
In Code view, after making a change, click the Refresh button on the coding toolbar.
Select File > Check Page > Validate Markup.
In the Validation panel in the Results panel group (Window > Results), click the Play button
on the sidebar and select one of the validation options.
To jump to an error in your MXML:
Double-click the error in the Validation panel.
Tip: To validate ActionScript, compile the project. ActionScript errors, if any, will appear in the Output
panel.
Compiling files to check for errors
You can compile Flex files from time to time to check for errors and compilation warnings. After
the server compiles the file, Flex Builder displays any compile-time errors or warnings in the
Output panel. The panel includes ActionScript errors detected in ActionScript files attached to
the MXML file or in ActionScript embedded in the MXML file. You can also use the Output
panel to quickly jump to and fix errors.
You can also view the file in a browser after compiling it. For more information, see “Compiling
and running Flex files” on page 85.
Before you start, make sure you correctly defined a Flex testing server for Flex Builder, and that
the server is running. Flex Builder relies on the testing server to compile Flex files and return any
error messages. For more information, see “Starting a new application in Flex Builder” on page 9.