all groups > flash actionscript > september 2004 >
You're in the

flash actionscript

group:

How to get a button to repeat action.


How to get a button to repeat action. mjpawlowsky
9/23/2004 8:32:40 PM
flash actionscript:
I'm trying to find an event I can use to get a button to repeat an action until
the button is released.

I figure I can enter a loop during on(press) but I'm not sure on how to get
out of the loop.
Is there a way to test to see if the mouse was released?

Or is there a better way to do this?

Thanks for answering my question,
Mike


Re: How to get a button to repeat action. ufitzi
9/23/2004 8:43:26 PM
Look up the documentation on setInterval and clearInterval

Basically, you call setInterval() on(press), and clearInterval
on(release,releaseOutside)

setInterval takes as args a reference to some function (the function you want
to invoke), #ms to wait before calling the function again, and optional others..

The call to setInterval returns "An interval identifier that you can pass to
clearInterval() to cancel the interval." (copyright Macromedia AS dictionary)

"Hope this gets you on the path to greatness..."
Re: How to get a button to repeat action. mjpawlowsky
9/23/2004 11:09:50 PM
Thanks a lot for poining me in the right direction.

Cheers,
Mike
AddThis Social Bookmark Button