Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Control Sounds: play, return, pause

New Here ,
Apr 27, 2013 Apr 27, 2013

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.

TOPICS
ActionScript
433
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 27, 2013 Apr 27, 2013
LATEST

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines