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

Adobe Animate cc 2020 - Creating a soundboard with pause and stop functionality

New Here ,
Dec 31, 2019 Dec 31, 2019

Copy link to clipboard

Copied

Hello,

 

I'm trying to create a very unique soundboard to use with theatre sound effects and music. I created one using Actionscript 3.0 that plays very short clips with no stop or pause. I want to add longer clips that I can play, stop or even pause. This button play plays but I am trying how to stop, and pause. Any help would be much appreciated. 

 

Button Help.jpg  

TOPICS
ActionScript

Views

457

Translate

Translate

Report

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

correct answers 1 Correct answer

Community Expert , Jan 01, 2020 Jan 01, 2020

i don't know why you're showing a button "timeline" because that's not relevant to what you want.  ie, whether you use a button (or buttons) or movieclip (or movieclips) to start, play, stop and pause is incidental.

 

you can use:

 

var sound:Sound;

var sc:SoundChannel;

var pos:Number;

 

function playF(s:Sound):void{

sc = s.play();

sound =s;

}

function stopF():void{

pos = sc.position;

sc.stop();

}

function resumeF():void{

sc = sound.play(pos);

}

 

p.s.  you'll probably want to add idiot-proofing

...

Votes

Translate

Translate
Community Expert ,
Jan 01, 2020 Jan 01, 2020

Copy link to clipboard

Copied

i don't know why you're showing a button "timeline" because that's not relevant to what you want.  ie, whether you use a button (or buttons) or movieclip (or movieclips) to start, play, stop and pause is incidental.

 

you can use:

 

var sound:Sound;

var sc:SoundChannel;

var pos:Number;

 

function playF(s:Sound):void{

sc = s.play();

sound =s;

}

function stopF():void{

pos = sc.position;

sc.stop();

}

function resumeF():void{

sc = sound.play(pos);

}

 

p.s.  you'll probably want to add idiot-proofing to prevent playing of multiple sounds

Votes

Translate

Translate

Report

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
New Here ,
Jan 03, 2020 Jan 03, 2020

Copy link to clipboard

Copied

Got it. I'm new to coding. I will take me some time to build this thing.

Votes

Translate

Translate

Report

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
Community Expert ,
Jan 03, 2020 Jan 03, 2020

Copy link to clipboard

Copied

LATEST

you're welcome.

Votes

Translate

Translate

Report

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