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

Code

car.addEventListener(MouseEvent.CLICK, carClick);
car.buttonMode=true;
function carClick(event:MouseEvent):void
{
   var snd:Honk=new Honk();
	 snd.play();
}

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

NEXT: Adjust the volume two ways