Flash Tutorial: Play Pause Toggle Button with actionscript 3; cs5 / cs5.5

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
4,737
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Aug 9, 2011

Available for download at http://qualitylessons.net/downloads

Flash Tutorial: Play Pause Toggle Button with actionscript 3; cs5 / cs5.5

Playing sounds using ActionScript 3.0 is not as simple as we hoped it to be as it requires using more than one class to perform even the simplest of tasks relating to sound such as pausing or changing the sound volume. This tutorial will teach you all the basics you need to learn how to start playing local sound.

Sounds in ActionScript 3.0 are manipulated through the collaborative work of several classes together. This is a much more complex structure than previous versions of ActionScript, but it is argued that this format will provide you with greater control and the ability to micro manage sounds. Here are the relevant classes related to sounds: Sound Class - This is the main class in which a sound will actually reside. This class is the starting point of any sound related program and is used to start playing a sound. SoundChannel Class - A sound can be played through a sound channel which provides additional controls over a sound object, the most basic of these additional controls is the ability to stop the playback of a sound.

Stopping A Sound

In addition the ability to play a sound, you will obviously also want to know how to stop your sound after you play it. The Sound Class does not have a method for stopping a sound. The SoundChannel Class must be used to perform that task. A SoundChannel is a class that is used to hold a raw sound object and then manipulate it using the methods and properties of the SoundChannel Class. The methods and properties you should be aware of are: .stop() - this method stops the sound playing through the channel. .position - this property is used to retrieve the current playback position of the sound playing through the channel.

Mohit Manuja

http://adobecs5.in

http://FlashLessons.Info

mohitsmail@yahoo.com

+91-9022995952

Trainer for Adobe Products Dreamweaver and Flash ( cs 5 / cs 5.5 ), round the Globe

  • likes, 5 dislikes

Link to this comment:

Share to:

Uploader Comments (zorro30mum)

  • Awesome tutorial. Thank you very much, I have been looking for a long time to find a good AS3 tutorial. Are you going to upload anymore Flash tuts?

  • @paranoi4en of course i don't think im gonna stop in the near future , out of my 160 odd tuts 100 plus must be on as 3 , most of them on the sound class ...btw thanks

  • error..

    

  • @yoramzeeman  all my files get tested 10 times and i work on them for hours before i post them..its very easy to pass in your verdict in seconds..comment negated and neglected !

  • Hi can you pls send me that script to my email on youtube? i need it today if you could send it :-) plsss thx you so much.

    And you should also post to another people in the description it will be fine for you :-)

  • @janya171 i tried to send u a msg but its says u have enabled friend lock ..

    how else can i send u an email ? ..all i know is how to send a msg thru yr channel.

    i dont like to post the code here , ppl will avoid watching and understanding the tutorial

Video Responses

see all

All Comments (13)

Sign In or Sign Up now to post a comment!
  • @zorro30mum I saw your channel, and you seem to be good at web design and stuff. I am going to university soon, so which will you advise me to learn - Java or C#?

  • Really Good Tutorial !

    What changes can I make to do the opposite? (Your Video starts: playing the song then you can Pause then Play).

    But I want to make it the same as yours but with the exception of the song to be stopped then Play and Pause!

    Please advise.

  • @janya171 you didn't give an instance name to the movie clip created with the two buttons

    it must be called btn

  • works great !!! Thanks

    to everyone that gets mistakes watch the script carefuly for typing errors etc.

  • I wanted to make an infinite loop with my sound, so I just make it play again in the SOUND_COMPLETE event, and register the SOUND_COMPLETE event again. Not sure if this is a good way thought... any advice anyonw ? ^^

Loading...

Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more