Aug 27, 2003 #1 simonWMC Programmer Dec 2, 2002 180 GB Hello I want to create a short delay using actionscript. When the user presses a button I want the playhead to go to a certain frame wait for 5 seconds then goto anothoer frame. is this possible ? I'm sure it is.....
Hello I want to create a short delay using actionscript. When the user presses a button I want the playhead to go to a certain frame wait for 5 seconds then goto anothoer frame. is this possible ? I'm sure it is.....
Aug 27, 2003 1 #2 billwatson Instructor Dec 18, 2002 2,312 CA my_btn.onRelease = function(){ gotoAndStop(...); wait = setInterval(paused,5000); function paused(){ clearInterval(wait); gotoAndStop(...) } } Upvote 0 Downvote
my_btn.onRelease = function(){ gotoAndStop(...); wait = setInterval(paused,5000); function paused(){ clearInterval(wait); gotoAndStop(...) } }
Aug 27, 2003 Thread starter #3 simonWMC Programmer Dec 2, 2002 180 GB thanks Bill I have this attached to the actual button, and am using it to control a movie clip. The code i now have is : onRelease = function(){ w_fback.play(2); wait = setInterval(paused,5000); function paused(){ clearInterval(wait); w_fback.play(1); } } I am getting a handler error on the first line. I tried : on(release) = function(){ that doesn't work either. I don't understand that first line - any ideas ? thanks again Upvote 0 Downvote
thanks Bill I have this attached to the actual button, and am using it to control a movie clip. The code i now have is : onRelease = function(){ w_fback.play(2); wait = setInterval(paused,5000); function paused(){ clearInterval(wait); w_fback.play(1); } } I am getting a handler error on the first line. I tried : on(release) = function(){ that doesn't work either. I don't understand that first line - any ideas ? thanks again
Aug 27, 2003 #4 billwatson Instructor Dec 18, 2002 2,312 CA that code was for the button having an instance name and should have gone on main timeline to attach to the button use on(release){ _root.w_fback.gotoandplay(2); wait = setInterval(paused,5000); function paused(){ clearInterval(wait); _root.w_fback.gotoandplay(1); } } play() means something else i think you mean to use gotoandplay or gotoandstop Upvote 0 Downvote
that code was for the button having an instance name and should have gone on main timeline to attach to the button use on(release){ _root.w_fback.gotoandplay(2); wait = setInterval(paused,5000); function paused(){ clearInterval(wait); _root.w_fback.gotoandplay(1); } } play() means something else i think you mean to use gotoandplay or gotoandstop
Aug 27, 2003 Thread starter #5 simonWMC Programmer Dec 2, 2002 180 GB silly me !!! changed the first line back to arrest.onRelease = function(){ and put in on the timeline - works perfectly thanx bill !!!! have a star ! Upvote 0 Downvote
silly me !!! changed the first line back to arrest.onRelease = function(){ and put in on the timeline - works perfectly thanx bill !!!! have a star !
Aug 27, 2003 #6 oldnewbie Technical User Dec 6, 2000 9,142 CA Code: on(release){ w_fback.gotoAndStop(2); wait = setInterval(paused,5000); function paused(){ clearInterval(wait); w_fback.gotoAndStop(1); }; } Regards, Upvote 0 Downvote
Code: on(release){ w_fback.gotoAndStop(2); wait = setInterval(paused,5000); function paused(){ clearInterval(wait); w_fback.gotoAndStop(1); }; } Regards,
Aug 27, 2003 #7 oldnewbie Technical User Dec 6, 2000 9,142 CA Untested... Code: on(release){ w_fback.gotoAndStop(2); wait = setInterval(paused,5000); function paused(){ clearInterval(wait); w_fback.gotoAndStop(1); }; } Regards, Upvote 0 Downvote
Untested... Code: on(release){ w_fback.gotoAndStop(2); wait = setInterval(paused,5000); function paused(){ clearInterval(wait); w_fback.gotoAndStop(1); }; } Regards,
Aug 27, 2003 Thread starter #8 simonWMC Programmer Dec 2, 2002 180 GB yes - i have been using play(), as i changed it to movie clips rather than on the timeline. cheers Upvote 0 Downvote
Aug 27, 2003 Thread starter #9 simonWMC Programmer Dec 2, 2002 180 GB if i want to add that same script to three buttons on the same frame is there an easy way to do it ? Or do I need to copy it underneath like this : arrest.onRelease = function(){ w_fback.play(2); wait = setInterval(paused,5000); function paused(){ clearInterval(wait); w_fback.play(1); } } charge.onRelease = function(){ w_fback.play(2); wait = setInterval(paused,5000); function paused(){ clearInterval(wait); w_fback.play(1); } } Upvote 0 Downvote
if i want to add that same script to three buttons on the same frame is there an easy way to do it ? Or do I need to copy it underneath like this : arrest.onRelease = function(){ w_fback.play(2); wait = setInterval(paused,5000); function paused(){ clearInterval(wait); w_fback.play(1); } } charge.onRelease = function(){ w_fback.play(2); wait = setInterval(paused,5000); function paused(){ clearInterval(wait); w_fback.play(1); } }
Aug 27, 2003 #10 billwatson Instructor Dec 18, 2002 2,312 CA one way arrest.onRelease = charge.onRelease = function(){ w_fback.play(2); wait = setInterval(paused,5000); } function paused(){ clearInterval(wait); w_fback.play(1); } Upvote 0 Downvote
one way arrest.onRelease = charge.onRelease = function(){ w_fback.play(2); wait = setInterval(paused,5000); } function paused(){ clearInterval(wait); w_fback.play(1); }
Aug 28, 2003 Thread starter #11 simonWMC Programmer Dec 2, 2002 180 GB That works well, thankyou Trouble is now, something else wierd has happened. If the user clicks the button a second time, before the code has finished - ie, after the wait. It just loops and goes back to the start. Is it possible to stop the second click until the wait time has elapsed. Or can anyone think of a better way of doing it ? Thanks all, i really appreciate your help Upvote 0 Downvote
That works well, thankyou Trouble is now, something else wierd has happened. If the user clicks the button a second time, before the code has finished - ie, after the wait. It just loops and goes back to the start. Is it possible to stop the second click until the wait time has elapsed. Or can anyone think of a better way of doing it ? Thanks all, i really appreciate your help
Aug 28, 2003 #12 billwatson Instructor Dec 18, 2002 2,312 CA arrest.onRelease = charge.onRelease = function(){ clearInterval(wait) w_fback.play(2); wait = setInterval(paused,5000); } function paused(){ clearInterval(wait); w_fback.play(1); } that should do it Upvote 0 Downvote
arrest.onRelease = charge.onRelease = function(){ clearInterval(wait) w_fback.play(2); wait = setInterval(paused,5000); } function paused(){ clearInterval(wait); w_fback.play(1); } that should do it