Chapter 13. Sound

LET’S FACE IT—SOUND IS FUN to work with! Unfortunately, when working with sound in ActionScript 2, we’ve had to create a lot of the functionality ourselves, using custom code. In ActionScript 3, we no longer need to write custom code when working with the Sound object, but in general, we have to write more lines to achieve the same effects. Fortunately, existing code is always easier to write than customized code.

Loading

The ability to play sound with ActionScript usually begins with the loading of an external MP3.

AS2: Loading

Loading an external sound file with ActionScript 2 is fairly simple. First you create a Sound object instance and add it as a class property for later access in the class. Once the Sound instance is created, ...

Get The ActionScript™ 3.0 Migration Guide: Making the Move from ActionScript 2.0 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.