Sound in Actionscript3

We will play a sound when we click the car

Please see the demo on playing a sound in a button.

Get Adobe Flash player


car.addEventListener(MouseEvent.CLICK, carClick);
function carClick(event:MouseEvent):void
   var snd:Honk=new Honk();;

Experiment: Try importing a sound to the library, then playing it using ActionScript.

NEXT: Adjust the volume two ways