User Guide Cancel

Debugging ActionScript 3.0

  1. Adobe Animate User Guide
  2. Introduction to Animate
    1. What's New in Animate
    2. Visual Glossary
    3. Animate system requirements
    4. Animate keyboard shortcuts
    5. Work with Multiple File Types in Animate
  3. Animation
    1. Animation basics in Animate
    2. How to use frames and keyframes in Animate
    3. Frame-by-frame animation in Animate
    4. How to work with classic tween animation in Animate
    5. Brush Tool
    6. Motion Guide
    7. Motion tween and ActionScript 3.0
    8. About Motion Tween Animation
    9. Motion tween animations
    10. Creating a Motion tween animation
    11. Using property keyframes
    12. Animate position with a tween
    13. How to edit motion tweens using Motion Editor
    14. Editing the motion path of a tween animation
    15. Manipulating motion tweens
    16. Adding custom eases
    17. Creating and applying Motion presets
    18. Setting up animation tween spans
    19. Working with Motion tweens saved as XML files
    20. Motion tweens vs Classic tweens
    21. Shape tweening
    22. Using Bone tool animation in Animate
    23. Work with character rigging in Animate
    24. How to use mask layers in Adobe Animate
    25. How to work with scenes in Animate
  4. Interactivity
    1. How to create buttons with Animate
    2. Convert Animate projects to other document type formats
    3. Create and publish HTML5 Canvas documents in Animate
    4. Add interactivity with code snippets in Animate
    5. Creating custom HTML5 Components
    6. Using Components in HTML5 Canvas
    7. Creating custom Components: Examples
    8. Code Snippets for custom Components
    9. Best practices - Advertising with Animate
    10. Virtual Reality authoring and publishing
  5. Workspace and workflow
    1. Creating and managing Paint brushes
    2. Using Google fonts in HTML5 Canvas documents
    3. Using Creative Cloud Libraries and Adobe Animate
    4. Use the Stage and Tools panel for Animate
    5. Animate workflow and workspace
    6. Using web fonts in HTML5 Canvas documents
    7. Timelines and ActionScript
    8. Working with multiple timelines
    9. Set preferences
    10. Using Animate authoring panels
    11. Create timeline layers with Animate
    12. Export animations for mobile apps and game engines
    13. Moving and copying objects
    14. Templates
    15. Find and Replace in Animate
    16. Undo, redo, and the History panel
    17. Keyboard shortcuts
    18. How to use the timeline in Animate
    19. Creating HTML extensions
    20. Optimization options for Images and Animated GIFs
    21. Export settings for Images and GIFs
    22. Assets Panel in Animate
  6. Multimedia and Video
    1. Transforming and combining graphic objects in Animate
    2. Creating and working with symbol instances in Animate
    3. Image Trace
    4. How to use sound in Adobe Animate
    5. Exporting SVG files
    6. Create video files for use in Animate
    7. How to add a video in Animate
    8. Draw and create objects with Animate
    9. Reshape lines and shapes
    10. Strokes, fills, and gradients with Animate CC
    11. Working with Adobe Premiere Pro and After Effects
    12. Color Panels in Animate CC
    13. Opening Flash CS6 files with Animate
    14. Work with classic text in Animate
    15. Placing artwork into Animate
    16. Imported bitmaps in Animate
    17. 3D graphics
    18. Working with symbols in Animate
    19. Draw lines & shapes with Adobe Animate
    20. Work with the libraries in Animate
    21. Exporting Sounds
    22. Selecting objects in Animate CC
    23. Working with Illustrator AI files in Animate
    24. Applying blend modes
    25. Arranging objects
    26. Automating tasks with the Commands menu
    27. Multilanguage text
    28. Using camera in Animate
    29. Graphic filters
    30. Sound and ActionScript
    31. Drawing preferences
    32. Drawing with the Pen tool
  7. Platforms
    1. Convert Animate projects to other document type formats
    2. Custom Platform Support
    3. Create and publish HTML5 Canvas documents in Animate
    4. Creating and publishing a WebGL document
    5. How to package applications for AIR for iOS
    6. Publishing AIR for Android applications
    7. Publishing for Adobe AIR for desktop
    8. ActionScript publish settings
    9. Best practices - Organizing ActionScript in an application
    10. How to use ActionScript with Animate
    11. Accessibility in the Animate workspace
    12. Writing and managing scripts
    13. Enabling Support for Custom Platforms
    14. Custom Platform Support Overview
    15. Working with Custom Platform Support Plug-in
    16. Debugging ActionScript 3.0
    17. Enabling Support for Custom Platforms
  8. Exporting and Publishing
    1. How to export files from Animate CC
    2. OAM publishing
    3. Exporting SVG files
    4. Export graphics and videos with Animate
    5. Publishing AS3 documents
    6. Export animations for mobile apps and game engines
    7. Exporting Sounds
    8. Best practices - Tips for creating content for mobile devices
    9. Best practices - Video conventions
    10. Best practices - SWF application authoring guidelines
    11. Best practices - Structuring FLA files
    12. Best Practices to optimize FLA files for Animate
    13. ActionScript publish settings
    14. Specify publish settings for Animate
    15. Exporting projector files
    16. Export Images and Animated GIFs
    17. HTML publishing templates
    18. Working with Adobe Premiere Pro and After Effects
    19. Quick share and publish your animations
  9. Troubleshooting
    1. Fixed issues
    2. Known issues

 

About the ActionScript 3.0 debugger

Animate includes a separate debugger for ActionScript 3.0 that operates differently from the ActionScript 2.0 debugger. The ActionScript 3.0 debugger only works with ActionScript 3.0 FLA and AS files. FLA files must have publish settings set to Flash Player 9. When you initiate an ActionScript 3.0 debugging session, Animate launches the stand-alone debug version of Flash Player to play the SWF file. The debug Flash player plays the SWF in a separate window from the Animate authoring application window.

The ActionScript 3.0 debugger converts the Animate workspace to a debug workspace that displays panels that are used for debugging. It also includes the Actions panel and/or Script window, the Debug console, and the Variables panel. The Debug console displays the call stack and contains tools for stepping through scripts. The Variables panel displays the variables in the current scope with their values and allows you to update those values yourself.

Additional resources

The following resources provide additional detailed information about debugging ActionScript 3.0:

Enter debugging mode

The way you begin a debugging session depends on the type of file you are working on. During a debugging session, Animate interrupts the execution of ActionScript when it encounters a breakpoint or a runtime error.

When Animate initiates a debug session, it adds special information to the SWF file that it exports for the session. This information allows the debugger to provide the specific line numbers in the code where errors are encountered.

You can include this special debugging information in all SWF files created from a specific FLA file in the Publish settings. This allows you to debug the SWF file even if you do not explicitly initiate a debug session. This debugging information makes the SWF file slightly larger.

Choose a default debugging environment

  • Choose Debug > Debug Movie and then choose one of the following:

    • Animate

    • AIR Debug Launcher (Desktop)

    • AIR Debug Launcher (Mobile)

    • on Device via USB (CS5.5 only)

    All debug sessions will take place in the environment you choose. You can change the default environment at any time.

Start debugging from a FLA file

  1. Select Debug > Debug

    (Versions CS6 and earlier) Select Debug > Debug Movie > Debug.

Start debugging from an ActionScript 3.0 AS file

  1. With the ActionScript file open in the Script window, select the FLA file that the ActionScript file should be compiled with from the Target menu at the top of the Script window. The FLA file must also be open to appear in this menu.

  2. Select Debug > Debug

    (Version CS6 and earlier) Select Debug > Debug Movie > Debug.

Add debugging information to all SWF files created from a FLA file

  1. With the FLA file open, select File > Publish Settings.

  2. In the Publish Settings dialog box, click the tab (CS5) or category (CS5.5).

  3. Select Permit Debugging.

Exit debugging mode

  1. Click the End Debug Session button in the Debug Console.

Set and remove breakpoints

Add breakpoints to ActionScript code to interrupt the execution of the code. After execution is interrupted, you can step through and execute the code line by line, view different sections of your ActionScript, view the values of variables and expressions, and edit variable values.

 Breakpoints cannot be added to ASC (ActionScript for Communication) or JSFL (Flash JavaScript) files.

Set a breakpoint

  1. In the Actions panel or Script window, click in the left margin next to the line of code where you want the breakpoint to appear.

Remove a breakpoint

  1. In the Actions panel or Script window, click on the breakpoint to remove.

Step through lines of code

After the ActionScript execution is interrupted at a breakpoint or runtime error, you can step through the code line by line. You may choose to step into function calls or step over them. You can also choose to continue executing the code without stepping.

Step into code line by line

  1. Click the Step In button in the Debug Console.

Step over a function call

  1. Click the Step Over button in the Debug Console.

Step out of a function call

  1. Click the Step Out button in the Debug Console.

Resume normal code execution

  1. Click the Continue button in the Debug Console.

Display and examine scripts in the call stack

When code execution stops in the debugger, you can view the call stack in the Debug Console and display the scripts containing the functions in the call stack. The call stack shows the current list of nested function calls that are waiting to complete execution.

You can view the individual scripts that contain each function.

  1. In the Debug Console panel, double click the name of the script in the call stack.

Display and modify variable values

View and edit the values of variables and properties in the Variables panel.

View a variable value

  1. In the Variables panel, select the types of variables to display from the Panel menu.

    • Show Constants displays the values constants (variables having a fixed value).

    • Show Statics displays variables that belong to the class, rather than to instances of the class.

    • Show Inaccessible Member Variables displays variables that are not accessible to other classes or namespaces. This includes variables that are protected, private or internal to the namespace.

    • Show Additional Hexadecimal Display adds hexadecimal values wherever decimal values are displayed. This is mainly useful for color values. Hexadecimal values are not displayed for decimal values from 0 through 9.

    • Show Qualified Names displays variables types with both the package name and the class name.

  2. Expand the tree view of the object structure of the FLA until you see the variable to view.

Edit the value of a variable

  1. In the Variables panel, double click on the value of the variable.

  2. Enter the new value for the variable and press Enter. The new value is used during subsequent code execution.

Control compiler warnings

Control the types of compiler warnings that the ActionScript compiler generates in the Compiler Errors panel. When the compiler reports an error, double-click the error to navigate to the line of code that caused the error.

  1. Select File > Publish Settings.
  2. Click Animate.

  3. Click the ActionScript Settings button.
  4. Select among the Errors options:
    • Strict Mode reports warnings as errors, which means that compilation will not succeed if those errors exist.
    • Warnings Mode reports extra warnings that are useful for discovering incompatibilities when updating ActionScript 2.0 code to ActionScript 3.0.

When Animate encounters an error in ActionScript code, either during compiling or execution, it reports the error in the Compiler Errors panel. Navigate to the line of code that caused the error from the Compiler Errors panel.

  1. Double click the error in the Compiler Errors panel.

Debug a remote ActionScript 3.0 SWF file

With ActionScript 3.0, you can debug a remote SWF file by using the stand-alone, ActiveX, or plug‑in version of the Debug Flash Player, which you can find in the Animate install directory/Players/Debug/ directory. However, in the ActionScript 3.0 Debugger, remote debugging is limited to files located on the same localhost as the Animate authoring application, being played in the stand-alone debug player, ActiveX control, or plugin.

To permit remote debugging of the file, enable debugging in the Publish settings. You can also publish your file with a debugging password to ensure that only trusted users can debug it.

As in JavaScript or HTML, users can view client-side variables in ActionScript. To store variables securely, send them to a server-side application instead of storing them in your file. However, as a developer, you may have other trade secrets, such as movie clip structures, that you do not want to reveal. You can use a debugging password to protect your work.

Enable remote debugging of a SWF file and set a debugging password

In ActionScript 3.0 FLA files, code in frame scripts cannot be debugged. Only code in external AS files can be debugged with the ActionScript 3.0 Debugger.

  1. Open the FLA file.

  2. Select File > Publish Settings.

  3. In the Publish Settings dialog box, click the tab (CS5) or category (CS5.5), and then select Permit Debugging.

  4. Close the Publish Settings dialog box, and select one of the following commands:

    • File > Export > Export Movie

    • File > Publish

  5. Leave the SWF file on the local machine to perform a remote debug session on the localhost, or upload it to your web server.

    The SWF file contains no breakpoint information, so if you upload the file to a remote server you will not be able to step through code. Use the localhost to perform this task.

  6. In Animate, select Debug > Begin Remote Debug Session > ActionScript 3.0.

    Animate opens the ActionScript 3.0 Debugger and waits for a debug Flash Player to connect. You have 2 minutes to start the debug Flash Player. If more than 2 minutes elapse, repeat this step.

  7. Open the SWF file in the debug version of the Flash Player plugin, ActiveX control, or stand-alone player. The debug stand-alone player is located in the Animate install directory/Players/Debug/ directory. Do not connect to a file on another machine, as debugger will not be able to receive any breakpoint information.

    The debug session begins when the debug player connects to the ActionScript 3.0 Debugger panel.

     Remote debugging does not function if you select the Default Network Interface for AIR 3.4. Instead, select the options to provide Network Interface name and IP Address of the system.

Activate the Debugger from a remote location

  1. Open the Animate authoring application if it is not already open.

  2. Select Debug > Begin Remote Debug Session > ActionScript 3.0.

  3. In a browser or in the debugger version of the stand-alone player, open the published SWF file from the remote location.

    If the Remote Debug dialog box does not appear, right-click (Windows) or Control-click (Macintosh) in the SWF file to display the context menu, and select Debugger.

  4. In the Remote Debug dialog box, select Localhost and select the file to open.

    The display list of the SWF file appears in the Debugger. If the SWF file doesn’t play, the Debugger might be paused, so click Continue to start it.

 Adobe

Get help faster and easier

New user?