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

botao de pause ou codigo snippet para pause

Contributor ,
Feb 14, 2024 Feb 14, 2024

ola a todos

estou montando um arquivo com adobe animate

e preciso de um botão de pause(com codigo pronto)

ou codigo snippet de botao pause

nao achei nos presets do adobe animate

alguem pode me ajudar ?

como conseguir e proceder ?

obrigado a todos 

leo

preciso do pause para eventualmente parar no meio do loop 

envio anexo um video screen da situação

4.4K
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
replies 101 Replies 101
Community Expert ,
Feb 24, 2024 Feb 24, 2024

1:

on the first frame, add a layer with your next button and the code* for it.  lock that layer.

create two more layers: one for the pics and one for the music. 

 

2:

at each frame for pics and for music, make it a keyframe (already done for frame 1).

in the pic layer, add your pic

in the music layer, add your music (and make sure its sync propery is event, not stream)

 

3:

in the next frame, for pics and music make it a keyframe.

in that next frame for buttons, do NOT make it a keyframe.

 

4:

repeat step 3 for each pic and music

 

*

for your code, use:

 

import flash.media.SoundMixer;

import flash.events.MouseEvent;

 

this.stop();

your_button_reference.addEventListener(MouseEvent.CLICK, nextF);

 

function nextF(e:MouseEvent):void {

SoundMixer.stopAll();

this.nextFrame();
}

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
Community Expert ,
Feb 24, 2024 Feb 24, 2024

p.s. do not attach screenshots to the adobe forums.  copy and paste them into your message.  that makes it a lot easier to check those screenshots (especially, for those of us using mobiles devices when reading the forums).

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
Contributor ,
Feb 24, 2024 Feb 24, 2024

thats ok 

thanks for the support

 

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
Community Expert ,
Feb 24, 2024 Feb 24, 2024

what's ok?

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
Contributor ,
Feb 24, 2024 Feb 24, 2024

thank you man

i ll try it later

 

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
Community Expert ,
Feb 24, 2024 Feb 24, 2024

got it.

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
Contributor ,
Feb 24, 2024 Feb 24, 2024

what is this scheme for ?

for playpause button in the file i am working?

or for a slideshow with music

regards 

leo

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
Community Expert ,
Feb 24, 2024 Feb 24, 2024

it's for one button control of a slideshow with music.

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
Contributor ,
Feb 24, 2024 Feb 24, 2024

ok

 

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
Contributor ,
Feb 24, 2024 Feb 24, 2024

hello man

how does it work for going  on action script for next and back button in slideshow?

there are some presets in code snnipets

but your way has shown me that works better 

regards 

leo

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
Community Expert ,
Feb 24, 2024 Feb 24, 2024

in the button layer add a back or previous button, in addition to the next button.  

 

add the code:

 

previous_button.addEventListener(MouseEvent.CLiCK, prevF)

 

function prevF(e:MouseEvent):void{
SoundMixer.stopAll();

prevFrame();

}

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
Contributor ,
Feb 24, 2024 Feb 24, 2024

thanks man

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
Contributor ,
Feb 24, 2024 Feb 24, 2024

but where i am suposed to add ? 

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
Contributor ,
Feb 24, 2024 Feb 24, 2024

hello man

i placed a button to go back but plays more than one mp3 file

it gets all messed up - i put all in EVent

i need your action script instead of using presets inside animate

for button next n back

regards 

leo

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
Community Expert ,
Feb 24, 2024 Feb 24, 2024

what's your previous button code?

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
Contributor ,
Feb 24, 2024 Feb 24, 2024

the same

preview/ back button
preview.addEventListener(MouseEvent.CLiCK, prevF)

 

function prevF(e:MouseEvent):void{
SoundMixer.stopAll();

prevFrame();

}

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
Contributor ,
Feb 24, 2024 Feb 24, 2024

it apears this

Scene 1, Layer 'Layer_9', Frame 1, Line 1, Column 37 1119: Access of possibly undefined property CLiCK through a reference with static type Class.

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
Community Expert ,
Feb 24, 2024 Feb 24, 2024

any error messages?

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
Contributor ,
Feb 24, 2024 Feb 24, 2024

the error message is above ..."it appears 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
Community Expert ,
Feb 24, 2024 Feb 24, 2024

should be 

 

CLICK

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
Contributor ,
Feb 24, 2024 Feb 24, 2024

wha does it mean?

is it to replace for CLICK instead of CLiCK?

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
Community Expert ,
Feb 24, 2024 Feb 24, 2024

yes

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
Contributor ,
Feb 24, 2024 Feb 24, 2024

hello man 

thank you 

it worked

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
Community Expert ,
Feb 24, 2024 Feb 24, 2024

excellent 

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
Contributor ,
Feb 25, 2024 Feb 25, 2024

what about a play/pause button, fo pause in the middle of the music and continue from where its stoped

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