Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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();
}
Copy link to clipboard
Copied
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).
Copy link to clipboard
Copied
thats ok
thanks for the support
Copy link to clipboard
Copied
what's ok?
Copy link to clipboard
Copied
thank you man
i ll try it later
Copy link to clipboard
Copied
got it.
Copy link to clipboard
Copied
what is this scheme for ?
for playpause button in the file i am working?
or for a slideshow with music
regards
leo
Copy link to clipboard
Copied
it's for one button control of a slideshow with music.
Copy link to clipboard
Copied
ok
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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();
}
Copy link to clipboard
Copied
thanks man
Copy link to clipboard
Copied
but where i am suposed to add ?
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
what's your previous button code?
Copy link to clipboard
Copied
the same
preview/ back button
preview.addEventListener(MouseEvent.CLiCK, prevF)
function prevF(e:MouseEvent):void{
SoundMixer.stopAll();
prevFrame();
}
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
any error messages?
Copy link to clipboard
Copied
the error message is above ..."it appears this...."
Copy link to clipboard
Copied
should be
CLICK
Copy link to clipboard
Copied
wha does it mean?
is it to replace for CLICK instead of CLiCK?
Copy link to clipboard
Copied
yes
Copy link to clipboard
Copied
hello man
thank you
it worked
Copy link to clipboard
Copied
excellent
Copy link to clipboard
Copied
what about a play/pause button, fo pause in the middle of the music and continue from where its stoped