Skip to main content
Participating Frequently
April 27, 2013
Question

Control Sounds: play, return, pause

  • April 27, 2013
  • 1 reply
  • 456 views

Hi All,

I have a movie clip that i want to add sound to! I currently have three buttons, A) return, B) pause, C) Play. So return brings the movie clip back to frame one to begin again, pause pauses at the current frame, and play resumes play after pause. All this functionality is working properly. However I also want to do this with sound. I found a workout around by going to properties -> Sync -> Stream. Which allows these buttons to also control the sound...im not realy sure how or why?! But what I want to know is there a way to hard code it? I tried stopAllSounds(); but this did not work.

Here is a code snippet I am currently using for controling the movie clip to give you an idea:

case returnBt:

                {

                    gotoAndPlay(1);

                    break;

                }

                case playBt:

                {

                    play();

                    break;

                }

                case pauseBt:

                {

                    stop();

 

                    break;

                }

Thanks all, im curious to hear if there is a way to hard code it.

AS2 and AS3 answers welcome.

This topic has been closed for replies.

1 reply

Ned Murphy
Legend
April 27, 2013

Look into using the Sound class for playing/controlling sounds.  If you search Google using terms like "AS3 Sound tutorial" you should find what you need to implement this.