FORUMS: list search recent posts

button to run script, pause, then run again ?

COW Forums : Adobe Flash

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Andy Stokes
button to run script, pause, then run again ?
on Feb 24, 2007 at 4:22:53 am

Hi all,

I have some actionscript i'm using in a dynamic pageflip movie . Currently I have a button that when selected will run this code to flip the pages:-

nextBtn.onRelease = function() {
var nextPage = _parent.offsetPages(_parent.page+2,_parent.removedPages);
if(nextPage<=_parent.offsetPages(_parent.maxpage,_parent.removedPages)) _parent.gotoPage(nextPage);
}

How might I build a button that when selected will run this code, pause 3 seconds then run again. Ideally i'd like to make this a toggle button so when clicked once will start the loop, then disable when clicked again.

Any help would be greatly appreciated as i'm fairly new to actionscript.


Return to posts index

grafxflow
Re: button to run script, pause, then run again ?
on Feb 24, 2007 at 5:40:00 pm

Hi,

You could let the button carry out the action and disable it

button._enabled = false;

then have the last frame of your page-over animation activate the button again

button._enabled = true;

grafxflow


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 CreativeCOW.net All Rights Reserved
[TOP]