Is there an easy way to make a button that toggles from play/pause? Or should I ask, what is the best way.
thanks
s
Printable View
Is there an easy way to make a button that toggles from play/pause? Or should I ask, what is the best way.
thanks
s
you can do
on (release) {
play ();
}
and
on (release) {
stop ();
}
To skate342:
Thank you so much, I really love you right now for saving my life with these button codes.
If you wanted a single button that toggles between playing and not,
Actionscript Code:on(press){
if(playing){
this.stop();
}else{
this.play();
}
playing=!playing
}
OUCHIE,... WOW this thread is back from good old 2002 tisk tisk anna_2010,
RE: "
OUCHIE,... WOW this thread is back from good old 2002 tisk tisk anna_2010, "
What do you mean by that guardianKitty?
You obviously replied too! LOL But I have to say your timing couldn't have been more perfect! Thanks for your brilliant code also. :grouphug:
Now we are 2010, the first post is in 2002... and this post is still on the top of my list of threads... amazing !!! :D
Hey, can you help me do that but with two button images (play and pause) and toggle them?
hey people ive got a problem im hoping you can help me solve im trying to make a pause button and im not very good with action script ive made a attempt but it still comes up with two errors can anyone help me get read of them here is the code ive being devolping.
stop();
var interval:Number = setInterval(function () {
trace(interval);
play();
clearInterval(interval);
}, 24000);
Your code works for me, if you want it to execute once after 24 secs, just use "setTimeout(functionName,24000);"
Other than that i don't see what you need help with essentially.
thanks i knew i was close
still one error message ive now got it to this piont
on (release) {
stop();
var interval:Number = setInterval(function () {
trace(interval);
play();
clearInterval(interval);
"setTimeout(functionName,1000);//" ;
}})
and the error message that comes up is
**Error** Scene=Scene 1, layer=pause, frame=20:Line 8: ')' or ',' expected
}})
Total ActionScript Errors: 1 Reported Errors: 1
can anybody give me a hand with that and thanks i dont mean to be a pain.
I don't know what you are trying to do middles, but try this:
Actionscript Code:onRelease=function() {
stop();
function functionName(){
trace(interval);
play();
clearInterval(interval);
var interval=setInterval(functionName,1000);
}
}
ok that works and im making a duke box just had trouble with my pause button the rest is fine thanks for your help and if you need any in the future ill be happy to help
Nice! Glad I've helped you :)