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