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

flash actionscript

group:

multifunctional button


multifunctional button boris benc
11/19/2004 10:54:10 PM
flash actionscript:
I think about a button with some different actions to execute one after another
/constructing a cycle/.
============================================================ for instance the
button which after <first release> sends a 'string 1' to the output window;
and after <second release> sends a 'string 2' to the output window; and after
<n release> sends a 'string n' to the output window;
============================================================ thanks
==========================

on(release){
trace( "string1" );
}
Re: multifunctional button NSurveyor
11/19/2004 11:28:01 PM
Try something like this:

on (release) {
// Make the variable n, one bigger than it currently is,
n++;
// See what value n matches. And then do something depending, on the
result.
if (n == 1) {
// DO Something here
} else if (n == 2) {
// DO Something here
} else if (n == 3) {
// DO Something here
} else if (n == 4) {
// DO Something here
} else if (n == 5) {
// DO Something here
// Make n equal 0 so that when this button is pressed, it becomes 1
// and then 2, 3, 4, 5, 1, 2... (loops on and on and on....)
n = 0;
}
}
AddThis Social Bookmark Button