Photoshop Tutorials, Flash Tutorials, 3Ds Studio Max Tutorials, Web Design Tutorials


Software Tutorials

Featured Free Templates
View All Templates!
Preview  |  Download
Name: metamorph_flame
Downloads:
Preview  |  Download
Name: metamorph_skyandclouds
Downloads:
View All Templates!
Recommended Hosting:
Host Unlimited Domains on 1 Account
1500GB storage and 15000GB bandwidth for $6.95/mo!
Recommended Hosting:
Host Unlimited Domains on 1 Account
1500GB storage and 15000GB bandwidth for $6.95/mo!
:: Free Website Templates
Preview  |  Download Preview  |  Download Preview  |  Download
Name: metamorph_sunset Name: metamorph_flower Name: metamorph_waterfall
Downloads: Downloads: Downloads:

Do You Like Our Website? Share With Others!
GoogleGoogle slashdotYahooMyWebDiggTechnoratiDelicious
Page: 12345678910111213141516171819202122232425

Welcome To WebDesignTutorials.net Flash Tutorials Area - Password Verification

In this tutorial, you're going to learn how to pause sound objects in flash and make the sound/music resume exactly from where it was paused.

Note: This tutorial is much shorter than it seems, extra explanation is provided for your own benefit.

There are two ways to do this in flash:

The complicated way:

Using the "Get time" action to calculate the total duration of your sound object, measuring the elapsed time and making the sound object resume next time based on the calculated previous elapsed time. It involves complicated action scripting, which would make this tutorial listed in the "Advanced" category instead. Morover, the result is not always perfect, you can't get a 100% precision when it comes to resuming the sound object from where it was left out.

The easy way:

By setting your sound object to "streaming" and using a couple of simple action scripts to start and pause your sound, 100% precision. And that's what we're going to do in this tutorial. :)
By using "Streaming" sound, it means we are going to spread the music over the timeline of flash. We will place the object into a movie clip and it will be played normally like any flash animation once the "play" button is pressed. Pausing the movie clip in which the object resides will also result in pausing the sound object. We can resume that by using the "play" action again.

Let's get started!

1:

  • Start by creating 2 layers as shown in Fig 1, name them accordingly.

    image01
    Fig 1

Next, we're going to create a Movie Clip in which our sound object will be placed.

  • Go to Insert>New Symbol and set the settings shown in Fig 2.

    image02
    Fig 2

2:

Once you create your new symbol, you will be taken to it and you will notice Layer 1.

image03
Fig 3

Now we're going to import our sound to flash.

  • Go to File>Import and import your music or any sound clip (*.wav or *.mp3).

3:

Good :) your sound object is now in the Library of Flash, you can check if you want, go to Windows>Library (or press F11).

  • Select the second keyframe of Layer 1 and select "Insert Keyframe" (there's a good reason behind choosing the second frame instead of the first one, i will explain that in the following steps).

    image04
    Fig 4
  • Go to Windows>Properties. The Properties panel should appear at the buttom of the screen, select your sound object and set Sync to Stream -as shown below- and Loop to 0 just for this tutorial.

    image05

4:

Ok, now we're going to "spread" our sound/music over the timeline.

Depending on the length of your sound, right-click a keyframe on the timeline and select "Insert Keyframe".
Notice Fig 5, my music almost ends by the 190th keyframe. what we want is having the whole sound clip be played in flash, so we have to make sure we don't "insert keyframe" before the sound/music ends.

image06
Fig 5

Go back to the first frame, righ-click it and select Actions. Add a stop (); action to it.
The reason why we left that single keframe and added a stop action to it is because we don't want flash to play our music once the file is loaded, we want to control it and play it only when the "play" button is pressed.

5:

That's what your timeline should look like.

image07
Fig 6
  • click on "Scene 1" as shown in Fig 6 to go back to the main stage.

Only 3 more steps are left and you're going to be able to pause your music in flash :)

6:

Ok that looks good. We're back to the main stage, now we're going to place our Movie Clip that holds our music on the stage.

  • Go to Windows>Library and drag the "mymusic" movie clip to the stage, as shown in Fig 7.

    image08
    Fig 7
  • Click on the keyframe of the "sound" layer. You'll notice a little circle on the stage with a little "+" sign, that's the movie clip that we dragged. If you double click that, u'll be taken to it, you don't have to do that now, if you do, make sure you get back to scene 1 for the following step.

    image09

7:

Now we're going to add an "Instance Name" to our movie clip, this name will be used as a target to play and pause the movie clip.

  • Click once on the little "+" sign as shown above and go to to the Properties panel.
  • Name the movie clip "mymusic" as show in Fig 8.

    image10
    Fig 8

Good work, the following page is the last one, we're going to add actions to buttons.

8:

In this step, we're going to add 2 buttons to the "buttons" layer.

image11
Fig 9
  • As shown in Fig 9, click on the first frame of the "buttons" layer and create 2 buttons, play and pause.

image12

  • Right-click on the "play" button, go to Actions and add the following action:

image13

Add the following action to the "pause" button:

you're done! good job, now test your movie. :)

Conclusion:

What we did:

  • Created 2 layers, one for the buttons, and another for the sound object.
  • Imported our sound object to flash, placed it into a new Movie Clip we named "mymusic".
  • Dragged the Movie Clip from the library to the "Sound" layer of the main stage.
  • We added an Instance Name to our movie clip, this name was used in the Actions as a target to play and stop the movie clip.
  • Created 2 buttons, one for "play" and the other one for "pause"
  • added actions to the buttons.

A 100% precision, with minor action scripting. Hope you enjoyed this tutorial.

Download *.fla

Author: Aevision

Advertisements
Graphic Software, Flash Templates, Free Stock Photos, Web Templates, Web Design, Corporate Web Design, Royalty Free stock Photo, Affordable Website Design, Submit site, Add Url, Stock Photos, Survey Software, Anti Virus Software, E mail software, Computer Software

Premium Partners
  Free Website Templates - Flash templates, Affordable Website Design, Website Templates, Website Redesign, Custom Website Design, Web Design Tutorials, Flash Tutorials, Promotion Tutorials - that is what we do. Metamorphosis Design Studio offers quality, free and low cost web site templates for your business and personal life, we also offer affordable web design and site re-design.
  Vertex Website Tempales - It saves tones of time and money to use pre-made web designs to build your web site. You need a web site but you don't want to pay thousands dollars to professional web design companies? Our web templates is just for you! They are designed to be easilly edited by your favorite html editor, like MS FrontPage
  Photoshop Tutorials - Learn how to build stunning web pages using Adobe Photoshop, Macromedia Flash MX and 3D Studio Max software. The step-by-step approach makes it so easy, that even beginners can produce great web pages. Get started with these tutorials covering everything from page layout to content tips.
Free website templates and paid web templates are great tools to make your websites look perfect! You will save time and money with our flash templates and free website templates Our visitors are satisfied with the quality of our free and paid website templates! Please visit our free website templates and paid website templates sections. We offer free web templates, free web layouts, free web page templates and other stuff for free download. All templates come with the html and external css file so you may easily edit HTML with your favorite HTML editor. Feel free to download our free web templates for your personal websites.

Terms of use depend upon the website template vendor.
Home  |  Submit Tutorial  |  Top Sites  |  Free Templates  |  Website Templates  |  Privacy Policy  |  Contact Us
All Right Reserved by WebDesignTutorials.net