Running and Debugging ActionScript and Flex Applications
Run/debug configuration types
The following run/debug configuration types are available for Flash modules:
- Flash App configurations let you compile and then run or debug your Flash (ActionScript and Flex) applications. You can create the necessary configurations prior to running or debugging. You can also start running or debugging an application right in the editor, when working with your source code (see Running or debugging an application from within the editor).
- FlexUnit configurations let you compile and then run or debug your FlexUnit tests. See Testing ActionScript and Flex Applications.
- Flash Remote Debug configurations let you debug applications that have already been compiled and, if necessary, packaged, and are ready to be run on a local or remote computer, or a mobile device. See Using Flash Remote Debug configurations.
To be able to debug your applications:
- The applications must be debug-ready, that is, contain the necessary debug information.
- For Web-targeted applications, you must install the debugger version of Flash player or
the debugger version of the Flash player plugin for your Web browser.
Normally, this software is included in Flex SDKs.
You can also download the corresponding software separately from the Adobe Flash Player Downloads page.
Running or debugging an application from within the editor
How IntelliJ IDEA selects or creates a class-specific run/debug configuration
As already mentioned, when you run or debug your application from within the editor, IntelliJ IDEA first tries to find an existing run/debug configuration with the class you are currently working with as the main class.
If no such configuration is found, a new run/debug configuration is created.
If more than one configuration with the suitable main class is found, IntelliJ IDEA prioritizes the configurations according to the following conditions and select the one with the highest priority:
- The run/debug configuration is based on the active build configuration, the build configuration output type is Application, the main class is not overridden in the run/debug configuration.
- The run/debug configuration is based on a build configuration with the output type Application, the main class is not overridden in the run/debug configuration.
- The run/debug configuration is based on the active build configuration, the main class is overridden in the run/debug configuration.
- Any run/debug configuration with the suitable (overridden) main class.
When creating a new run/debug configuration, IntelliJ IDEA tries to find a build configuration with a suitable main class. If found, the new run/debug configuration will be based on such a build configuration. Otherwise, the active build configuration will be used, and the main class will be overridden in the new run/debug configuration.
Using Flash Remote Debug configurations
Select and start the necessary Flash Remote Debug configuration ( or Shift+F9).
As a result, the Debug tool window opens; the debugger is waiting for the application to connect.
- Now, to connect to the debugger, do one of the following:
- Start the Flash or AIR application on your local computer; the application will connect to the debugger automatically.
- If the application is already running in a Web browser or a Flash player on the local or remote computer, right-click the corresponding page in the browser or the application in the player, and select Debugger from the context menu.
- Start the application on the mobile device. If the device is capable of communicating with your computer, the application will connect to the debugger automatically.