Learn Flash Sound in HTML

Home Food Mates • Members Tutorials Forum Buy Templates Contact Us 

 


Flash Tutorials

   

Tutorial: Flash Sound on HTML Web Pages using JavaScript

 

Free Flash Sound Tutorial


Step 1    <<   Previous      Intro   1   2   JavaScript      Next   >>       >>   Webwasp Mates

 

Step One: Creating the Flash Movie

  1. Open a new Flash Movie.
  2. Save your new Flash Movie as: Sound
  3. Import your sound clip into Flash: File > Import > Import to Library
  4. Note: If you don't have a sound file ready, do a search your hard drive for: mp3 or wav
    Webwasp members can download the sound file used on this page: Login or Become a Member

  5. Create a new blank Movie Clip: Insert > Symbol (Short Cut Key: Ctrl + F8)
  6. Give it a name: Sound Player
  7. For Behavior select: Movie Clip
  8. Click: OK
  9. If the Edit Bar is closed, open it: Window > Tool Bars > Edit Bar
  10. In the Edit Bar Click on the Tab:

    This should take you back to the main stage. The main stage should still be empty.

  11. If the Library is closed, open it: Window > Library (Short Cut Key: F11)
  12. Drag the new Movie Clip onto the: Main Stage
  13. Give it unique Instance Name: MySoundPlayer

    You will use the Movie Clip instance name in the JavaScript to start or stop this sound.

  14. Open up the Movie Clip you just created. Right Click and select: Edit
  15. Add two Layers, so that you have a total of 3 Layers. use the Insert Layer Button:
  16. Rename the top Layer: Actions
  17. Rename the middle Layer: Labels
  18. Rename the bottom Layer: Sound
  19. In the Actions Layer add the following ActionScript:

        stop();
        stopAllSounds();


  20. In the Labels Layer in frame 1, add a label called: stop

    You add frame Labels from the Property Inspector: Window > Properties

  21. Right click on frame 5 (Mac: Ctrl + click) of the Labels Layer and select: Insert Blank Keyframe
  22. In the new Keyframe add a label named: start
  23. In frame 5 of the Sound Layer insert a: Blank Keyframe
  24. In Layer 5 of the Sound Layer add your: Sound

    Note: To add a sound to a Keyframe you need to first import a sound into the Library (Step 3 above).
    Then you select a Keyframe and use the Sound Option in the Property Inspector to add the sound to the selected frame.

  25. In frame 10 of the Labels Layer insert a: Blank Keyframe
  26. In this frame add a label: loop
  27. In frame 5 of the Labels Layer insert a: Blank Keyframe
  28. In frame 10 of the Labels Layer insert another: Blank Keyframe
  29. In frame 5 of the Actions Layer insert a: Blank Keyframe
  30. In frame 10 of the Actions Layer insert another: Blank Keyframe
  31. In frame 5 or the Actions Layer add the following ActionScript:

        stop();

  32. Do the same in frame 10 or the Actions Layer:

        stop();

  33. In frame 10 of your Sound Layer add your: Sound
  34. In the Sound Layer select: frame 5
  35. In the Property Inspector set the Sync to: Start (see illustration below)
  36. Set the Repeat to: 1 (see illustration below)
  37. In the Sound Layer select: frame 10
  38. In the property panel set Sync to: Start
  39. Set the Repeat to: Loop

  40. The Sync Properties.

    Note: Set the Sync Properties to: Start, Repeat and 1 to play a sound once.
    Change the value 1 if you want to play the sound a specific number of times.
    Change the second box to: Loop if you want the sound to repeat forever.


    Movie Clip Layers and Keyframes.

  41. Publish the move as a swf and call it: Sound.swf

    Note: You Publish the Movie by going to: File > Publish or File > Publish Settings > Publish

    There is no need to use the latest Flash Player. In the Publish Settings, click on the Flash Tab and select an older Flash Player such as: Player 5 or Player 6

         

Step 1    <<   Previous      Intro   1   2   JavaScript      Next   >>       >>   Webwasp Mates


Webwasp Community: Webwasp Mates & Dates

Why not try out webwasp's new community. Meet new people, find friends in your area: Webwasp Mates & Dates

 Top of Page Home Food Mates Members Tutorials Forum Buy Templates Contact Us 
 All material on this site is protected under international copyright © law. DO NOT reproduce any material from this site without written permission. Please ask as permission is often granted.