User Guide Cancel

ActionScript publish settings

  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

 

Use this article to work with ActionScript publish settings in Adobe Animate.

Modify ActionScript publish settings

When you create a new FLA document, Animate (formerly Animate) asks you which version of ActionScript you want to use. You can change this setting if you decide later to write your scripts in a different version of ActionScript.

 ActionScript 3.0 is not compatible with ActionScript 2.0. The ActionScript 2.0 compiler can compile all ActionScript 1.0 code, except for the slash (/) syntax used to indicate movie clip paths (for example, parentClip/testMC:varName= "hello world"). To avoid this problem, either rewrite your code using dot (.) notation, or select the ActionScript 1.0 compiler.

  1. Select File > Publish Settings.
  2. Select the ActionScript version from the Script menu.

Class files and configuration files

When you install Animate, several ActionScript-related configuration folders and files are placed on your system. If you modify these files to customize the authoring environment, back up the original files.

ActionScript classes folder

Contains all of the built-in ActionScript 2.0 classes (AS files). Typical paths to this folder are as follows:

  • Windows 7 and 8: Hard Disk\Program Files\Adobe\Adobe Animate\Common\Configuration\ActionScript 3.0\Configuration\Classes

  • Macintosh: Hard Disk/Users/user/Library/Application Support/Adobe/Animate/language/Configuration/Classes

    The Classes folder is organized into classes for Flash Player 10 and classes for Flash Player 11. For more information on the organization of this directory, see the Read Me file in the Classes folder.

Include class folder

Contains all of the global ActionScript include files. Locations are as follows:

  • Windows 7 and 8: Hard Disk\Program Files\Adobe\Adobe Animate\Common\Configuration\ActionScript 3.0\libs\

  • Macintosh: Hard Disk/Users/user/Library/Application Support/Adobe/Animate/language/Configuration/Include

ActionsPanel.xml configuration file

Includes the configuration file for ActionScript code hinting. Separate files provide configuration for each version of ActionScript and Flash Lite, and for JavaScript. Locations are as follows:

  • Windows 7 and 8: Hard Disk\Program Files\Adobe\Adobe Animate\Common\Configuration\ActionScript 3.0\libs\

  • Macintosh: Hard Disk/Users/user/Library/Application Support/Adobe/Animate/language/Configuration/ActionsPanel

AsColorSyntax.xml configuration file

The configuration file for ActionScript code color syntax highlighting. Locations are as follows:

  • Windows 7 and 8: Hard Disk\Program Files\Adobe\Adobe Animate\Common\Configuration\ActionScript 3.0\libs\

  • Macintosh: Hard Disk/Users/user/Library/Application Support/Adobe/Animate/language/Configuration/ActionsPanel

Declare an ActionScript 3.0 document class

When you use ActionScript 3.0, a SWF file may have a top-level class associated with it. This class is called the document class. When the SWF is loaded by Flash Player, an instance of this class is created to be the SWF file's top-level object. This object of a SWF file can be an instance of any custom class you choose.

For example, a SWF file that implements a calendar component can associate its top level with a Calendar class, with methods and properties appropriate to a calendar component. When the SWF is loaded, Flash Player creates an instance of this Calendar class.

  1. Deselect all objects on the Stage and in the Timeline by clicking a blank area of the Stage. This displays the Document properties in the Property inspector.
  2. Enter the filename of the ActionScript file for the class in the Document Class text box in the Property inspector. Do not include the .as filename extension.

 You can also enter the Document Class information in the Publish Settings dialog box.

 Optionally, you can also enter the name of the Class within a SWC file, linked in Library Path, that you want to set as the Document Class.

Set the location of ActionScript files

To use an ActionScript class that you’ve defined, Animate must locate the external ActionScript files that contain the class definition. The list of folders in which Animate searches for class definitions is called the classpath for ActionScript 2.0 and the source path for ActionScript 3.0. Classpaths and source paths exist at the application (global) and document level. For more information about classpaths, see Classes in Learning ActionScript 2.0 in Adobe Animate or “Packages” in Learning ActionScript 3.0.

You can set the following ActionScript locations in Animate:

  • ActionScript 2.0

    • Application level (available to all AS2 FLA files):

      • Classpath (set in ActionScript preferences)

    • Document level (available only to the FLA file that specifies this path):

      • Classpath (set in Publish Settings)

  • ActionScript 3.0

    • Application level (available to all AS3 FLA files):

      • Source path (set in ActionScript preferences)

      • Library path (set in ActionScript preferences)

      • External library path (set in ActionScript preferences)

    • Document level (available only to the FLA file that specifies these paths):

      • Source path (set in Publish Settings)

      • Library path (set in Publish Settings)

      • Document class (set in Document Property inspector)

The Library path specifies the location of pre-compiled ActionScript code which resides in SWC files you have created. The FLA file that specifies this path loads every SWC file at the top level of this path and any other code resources that are specified within the SWC files themselves. If you use the Library path, be sure none of the compiled code in the SWC files is duplicated in uncompiled AS files in the Source path. The redundant code will slow down compilation of your SWF file.

You can specify more than one path for Animate to look in. Resources found in any of the paths specified will be used. When you add or modify a path, you can add absolute directory paths (for example, C:/my_classes) and relative directory paths (for example, ../my_classes or ".").

Set the classpath for ActionScript 2.0

Note: ActionScript 2.0 is deprecated with Animate. For more information, see this article

To set the document-level classpath:

  1. Select File > Publish Settings, and click Flash.

  2. Verify that ActionScript 2.0 is selected in the ActionScript Version pop‑up menu, and click Settings.
  3. Specify the frame where the class definition should reside in the Export Frame for Classes text field.
  4. To add paths to the classpath list, do any of the following:
    • To add a folder to the classpath, click the Browse to Path button , browse to the folder to add, and click OK.

    • To add a new line to the Classpath list, click the Add New Path  button. Double-click the new line, type a relative or absolute path, and click OK.

    • To edit an existing classpath folder, select the path in the Classpath list, click the Browse to Path button, browse to the folder to add, and click OK. Alternatively, double-click the path in the Classpath list, type the desired path, and click OK.

    • To delete a folder from the classpath, select the path in the Classpath list and click the Remove Selected Path button .

To set the application-level classpath:

  1. Choose Edit Preferences (Windows) or Flash > Preferences (Macintosh) and click the ActionScript category.

  2. Click the ActionScript 2.0 Settings button and add the path(s) to the Classpath list

Set the source path for ActionScript 3.0

To set the document-level source path:

  1. Select File > Publish Settings, and click Flash.

  2. Verify that ActionScript 3.0 is selected in the ActionScript Version pop‑up menu, and click Settings. Your Flash Player version must be set to Flash Player 9 or later to use ActionScript 3.0.
  3. Specify the frame where the class definition should reside in the Export Classes in Frame text field.
  4. Specify the Errors settings. You can select Strict Mode and Warnings Mode. Strict Mode reports compiler warnings as errors, which means that compilation will not succeed if those types of errors exist. Warnings Mode reports extra warnings that are useful for discovering incompatibilities when updating ActionScript 2.0 code to ActionScript 3.0.
  5. (Optional) Select Stage to automatically declare stage instances.
  6. Specify ActionScript 3.0 or ECMAScript as the dialect to use. ActionScript 3.0 is recommended.
  7. To add paths to the source path list, do any of the following:
    • To add a folder to the source path, click the Source path tab and then click the Browse To Path button , browse to the folder to add, and click OK.

    • To add a new line to the Source path list, click the Add New Path  button. Double-click the new line, type a relative or absolute path, and click OK.

    • To edit an existing Source path folder, select the path in the Source path list, click the Browse To Path button, browse to the folder to add, and click OK. Alternatively, double-click the path in the Source path list, type the desired path, and click OK.

    • To delete a folder from the source path, select the path in the Source path list and click the Remove From Path button .

To set the application-level source path:

  1. Choose Edit Preferences (Windows) or Animate > Preferences (Macintosh) and click the ActionScript category.

  2. Click the ActionScript 3.0 Settings button and add the path(s) to the Source path list.

Set the Library path for ActionScript 3.0 files

To set the document-level Library path, the procedure is similar to setting the Source path:

  1. Choose File Publish Settings.
  2. Make sure ActionScript 3.0 is specified in the Script menu and click the ActionScript Settings button.
  3. In the Advanced ActionScript 3.0 Settings dialog box, click the Library path tab.
  4. Add the library path to the Library path list. You can add folders or individual SWC files to the path list.
  5. To set the Link Type property, double-click Link Type in the property tree of the path. The choices for Link Type are:
    • Merged into code: The code resources found in the path are merged into the published SWF file.

    • External: The code resources found in the path are not added to the published SWF file, but the compiler verifies that they are in the locations you specified.

    • Runtime shared library (RSL): Flash Player downloads the resources at runtime.

To set the Application-level Library path:

  1. Choose Edit Preferences (Windows) or Animate > Preferences (Macintosh) and click the ActionScript category.

  2. Click the ActionScript 3.0 Settings button and add the path(s) to the Library path list.

Compiling ActionScript conditionally

You can use conditional compilation in ActionScript 3.0 in the same way that it has been used in C++ and other programming languages. For example, you can use conditional compilation to turn blocks of code throughout a project on of off, such as code that implements a certain feature or code used for debugging.

Using config constants that you define in the publish settings, you can specify whether certain lines of ActionScript code are compiled or not. Each constant takes the following form:

CONFIG::SAMPLE_CONSTANT

In this form, CONFIG is the config namespace and SAMPLE_CONSTANT is the constant that you will set to true or false in the publish settings. When the value of the constant is true, the line of code that follows the constant in ActionScript is compiled. When the value is false, the line of code that follows the constant is not compiled.

For example, the following function has 2 lines of code that are compiled only if the value of the constant that precedes them is set to true in the publish settings:

public function CondCompTest() { 
    CONFIG::COMPILE_FOR_AIR { 
        trace("This line of code will be compiled when COMPILE_FOR_AIR=true."); 
    } 
    CONFIG::COMPILE_FOR_BROWSERS { 
        trace("This line of code will be compiled when COMPILE_FOR BROWSERS=true."); 
    } 
}

To define a config constant using the Publish Settings dialog box:

  1. Choose File > Publish Settings.

  2. Ensure that the Script menu set to ActionScript 3.0 and click the Settings button next to the menu.

  3. In the Advanced ActionScript 3.0 Settings dialog box, click the Config Constants tab.

  4. To add a constant, click the Add button.

  5. Type the name of the constant you want to add. The default config namespace is CONFIG and the default constant name is CONFIG_CONST.

    Note:

    The config namespace CONFIG is declared by the Animate compiler automatically. You can add your own config namespaces by entering them with a constant name in the publish settings and adding them to your ActionScript code using the following syntax:

    config namespace MY_CONFIG;
  6. Enter the value you want for the constant, either true or false. You change this value in order to turn on or off compilation of specific lines of code.

Customizing context menus in documents (CS5.5)

You can customize the standard context menu and the text-editing context menu that appears with SWF files in Flash Player 7 and later.

  • The standard context menu appears when a user right-clicks (Windows) or Control‑clicks (Macintosh) on a SWF file in Flash Player, in any area except an editable text field. You can add custom items to the menu, and hide any built‑in items in the menu except Settings and Debugger.

  • The editing context menu appears when a user right-clicks (Windows) or Control‑clicks (Macintosh) in an editable text field in a SWF file in Flash Player. You can add custom items to this menu. You cannot hide any built‑in items.

 Flash Player also displays an error context menu when a user right-clicks (Windows) or Control-clicks (Macintosh) in Flash Player and no SWF file is loaded. You cannot customize this menu.

Customize context menus in Flash Player 7 by using the ContextMenu and ContextMenuItem objects in ActionScript 2.0. For more information on using these objects, see ContextMenu in the ActionScript 2.0 Language Reference.

Remember the following conditions when creating custom context menu items for Flash Player:

  • Custom items are added to a context menu in the order in which they are created. You cannot modify this order after the items are created.

  • You can specify the visibility and enabling of custom items.

  • Custom context menu items are automatically encoded using Unicode UTF‑8 text encoding.

Configuration folders installed with Flash (CS5.5)

Flash places several configuration folders on your system when you install the application. The configuration folders organize files associated with the application into appropriate levels of user access. You may want to view the contents of these folders when you are working with ActionScript® or components. The configuration folders for Flash are as follows:

Application-level configuration folder

Because it is in the application level, non-administrative users do not have write access to this directory. Typical paths to this folder are as follows:

  • In Microsoft Windows XP or Microsoft Windows Vista, browse to boot drive\Program Files\Adobe\Adobe Flash CS3\language\Configuration\.

  • On the Macintosh, browse to Macintosh HD/Applications/Adobe Flash CS3/Configuration/.

First Run folder

This sibling to the application-level configuration folder facilitates sharing configuration files among users of the same computer. Folders and files in the First Run folder are automatically copied to the user-level configuration folder. Any new files placed in the First Run folder are copied to the user-level configuration folder when you start the application.

Typical paths to the First Run folder are as follows:

  • In Windows XP or Vista, browse to boot drive\Program Files\Adobe\Adobe Flash CS3\language\First Run\.

  • On the Macintosh, browse to Macintosh HD/Applications/Adobe Flash CS3/First Run/.

User-level configuration folder

Found in the user profile area, this folder is always writable by the current user. Typical paths to this folder are as follows:

  • In Windows XP or Vista, browse to boot drive\Documents and Settings\username\Local Settings\Application Data\Adobe\Flash CS3\language\Configuration.

  • On the Macintosh, browse to Macintosh HD/Users/username/Library/Application Support/Adobe/Flash CS3/language/Configuration/.

All-user-level configuration folder

Found in the common user profile area, this folder is part of the standard Windows and Macintosh operating system installations and is shared by all users of a particular computer. The operating system makes available to all users of the computer any files placed in this folder. Typical paths to this folder are as follows:

  • In Windows XP or Vista, browse to boot drive\Documents and Settings\All Users\Application Data\Adobe\Flash CS3\language\Configuration\.

  • On the Macintosh, browse to Macintosh HD/Users/Shared/Application Support/Adobe/Flash CS3/language/Configuration/.

Restricted Users configuration folder

For users with restricted privileges on a workstation, typically, in a networked environment, only system administrators have administrative access to workstations. All other users are given restricted access, which usually means that these users can’t write to application-level files (such as the Program Files directory in Windows or the Applications folder in Macintosh OS X).

 Adobe

Get help faster and easier

New user?