O'Reilly logo

ActionScript Graphing Cookbook by Peter Backx, Dominic Gélineau

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Adding sounds

To really finish off our relational network and to add strength to our animation, this recipe is going to add sounds to it all.

Getting ready

Open the files downloaded from the Packt Publishing website for Chapter 8 | Recipe 6 to follow along.

How to do it...

The following are the steps to add sounds to a relational network:

  1. In a Flash file (.fla), add four sounds for rollover, click, animation in, and animation out.
  2. Export that file as a .swc file.
  3. In FlashDevelop, right-click on the .swc file and choose Add to Library.
  4. In PlusButton.as, add a listener for the MouseEvent.ROLL_OVER event and for the MouseEvent.CLICK event.
  5. Add the corresponding functions:
    private function _onMouseClick(event:MouseEvent):void { _soundClick.play(0,0,new SoundTransform(2)); ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required