User Guide Cancel

Sound and ActionScript

  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

 

With ActionScript®, you can control sounds at runtime. Using ActionScript allows you to create interaction and other capabilities in your FLA files that is not possible with the Timeline alone.

AS3 Developer’s Guide: Working with Sound describes how to work with sound in ActionScript 3.0.

 (Animate only) ActionScript 2.0 and ActionScript 1.0 are not supported with Animate.

Control sounds using behaviors

Using sound behaviors, prewritten ActionScript 2.0, you can add sounds to your document and control sound playback. Adding a sound using these behaviors creates an instance of the sound, which is then used to control the sound.

 ActionScript 3.0 and Flash Lite 1.x and Flash Lite 2.x do not support behaviors.

Load a sound to a file using a behavior

  1. Select the object, such as a button, that you want to use to trigger the behavior.
  2. In the Behaviors panel (Window > Behaviors), click the Add (+) button and select Sound > Load Sound from Library or Sound > Load Streaming mp3 File.
  3. In the Load Sound dialog box, enter the linkage identifier for a sound from the Library, or the sound location for a streaming mp3 file. Next, enter a name for this instance of the sound, and click OK.
  4. In the Behaviors panel under event, click On Release (the default event), and select a mouse event from the menu. If you want to use the OnRelease event, do not change the option.

Play or stop sounds using a behavior

  1. Select the object, such as a button, that you want to use to trigger the behavior.
  2. In the Behaviors panel (Window > Behaviors), click the Add (+) button.
  3. Select Sound > Play Sound, Sound > Stop Sound, or Sound > Stop All Sounds.
  4. In the dialog box that appears, do one of the following:
    • Enter the linkage identifier and the instance name of the sound you want to play or stop, and click OK.

    • Click OK to verify that you want to stop all sounds.

  5. In the Behaviors panel under Event, click On Release (the default event) and select a mouse event from the menu. If you want to use the OnRelease event, do not change the option.

Control sounds with the ActionScript 2.0 Sound object

Use the Sound object in ActionScript 2.0 to add sounds to a document and to control sound objects in a document, including adjusting the volume or the right and left balance while a sound plays. For more information, see Creating sound controls in Learning ActionScript 2.0 in Flash.

  1. Select the sound in the Library panel.
  2. Select Linkage from the Panel menu in the upper-right corner of the panel, or right-click (Windows) or Control-click (Macintosh) the sound name in the Library panel and select Linkage from the context menu.
  3. Under Linkage in the Linkage Properties dialog box, select Export for ActionScript.
  4. Enter an identifier string in the box, and click OK.

About the ActionScript 2.0 onSoundComplete event

The onSoundComplete event of the ActionScript 2.0 Sound object lets you trigger an event in a Animate application based on completing an attached sound file. The Sound object is a built-in object that lets you control sounds in a Animate application. For more information, see Sound in the ActionScript 2.0 Language Reference. The onSoundComplete event of a Sound object is invoked automatically when the attached sound file finishes playing. If the sound is looped a specified number of times, the event is triggered when the sound finishes looping.

The Sound object has two properties that you can use with the onSoundComplete event. The duration property is a read-only property representing the duration, in milliseconds, of the sound sample attached to the sound object. The position property is a read-only property representing the number of milliseconds the sound has been playing in each loop.

The onSoundComplete event lets you manipulate sounds in a many ways, such as the following:

  • Creating a dynamic playlist or sequencer

  • Creating a multimedia presentation that checks for narration completion before advancing to the next frame or scene

  • Building a game that synchronizes sounds to particular events or scenes and transitions smoothly between different sounds

  • Timing an image change to a sound—for example, changing an image when a sound is halfway through at playback time

Accessing ID3 properties in mp3 files with Flash Player

Macromedia Flash Player 7 from Adobe and later supports ID3 v2.4 and v2.4 tags. With this version, when you load an mp3 sound using the ActionScript 2.0 attachSound() or loadSound() method, the ID3 tag properties are available at the beginning of the sound data stream. The onID3 event executes when the ID3 data is initialized.

Flash Player 6 (6.0.40.0) and later supports mp3 files with ID3 v1.0 and v1.1 tags. With ID3 v1.0 and v1.1 tags, the properties are available at the end of the data stream. If a sound does not contain an ID3v1 tag, the ID3 properties are undefined. Users must have Flash Player 6 (6.0.40.0) or later for the ID3 properties to function.

For more information on using the ID3 properties, see id3 (Sound.id3 property) in the ActionScript 2.0 Language Reference.

 Adobe

Get help faster and easier

New user?

Adobe MAX 2024

Adobe MAX
The Creativity Conference

Oct 14–16 Miami Beach and online

Adobe MAX

The Creativity Conference

Oct 14–16 Miami Beach and online

Adobe MAX 2024

Adobe MAX
The Creativity Conference

Oct 14–16 Miami Beach and online

Adobe MAX

The Creativity Conference

Oct 14–16 Miami Beach and online