red_sun
12-11-2003, 02:26 AM
Hello,every one!
I want my flash to obtain the following effect. But I am in trouble.
There are two buttons and a dynamic text box in my flash.The two buttons are start and end button. When you click the start button,you will find the random data in the dynamic text box changing constantly until you click the stop button.
Can anyone help me, thanks a lot!
I do try it myself!
I am just learning how to use actionscript!
Below is the start button script!
Hit is a variable in the dynamic text box!
on (release) {
a = random(300);
switch (true) {
case (a>0 && a<10) :
hit = "00"+""+a;
break;
case (a>9 && a<100) :
hit = "0"+""+a;
break;
default :
hit = a;
break;
}
}
It produces only a number when you click start button once!
Originally,I use a while loop in the script above,but it seems the loop will never stop. Although a global variable in End button to indicate the loop condition is false!:(
I want my flash to obtain the following effect. But I am in trouble.
There are two buttons and a dynamic text box in my flash.The two buttons are start and end button. When you click the start button,you will find the random data in the dynamic text box changing constantly until you click the stop button.
Can anyone help me, thanks a lot!
I do try it myself!
I am just learning how to use actionscript!
Below is the start button script!
Hit is a variable in the dynamic text box!
on (release) {
a = random(300);
switch (true) {
case (a>0 && a<10) :
hit = "00"+""+a;
break;
case (a>9 && a<100) :
hit = "0"+""+a;
break;
default :
hit = a;
break;
}
}
It produces only a number when you click start button once!
Originally,I use a while loop in the script above,but it seems the loop will never stop. Although a global variable in End button to indicate the loop condition is false!:(