PDA

View Full Version : One thing bothering me..


Normunds
12-09-2001, 02:14 PM
I would like to know one thing: can flash determine whether the value I entered in the text box is right , for example, according some kind of condition. For example you want to get a new variable that isnt grater than 5. You have an input textbox and a button which enters the value and when you type in the textbox a number 6, the button dissapears or says that its too small, but in realtime. If you understand what i am trying to say please answer.

Billy T
12-09-2001, 09:50 PM
this might help

poab
12-10-2001, 10:39 AM
Hi,

Flash can do that but it depends on the situation as to how you need to script it.

Because any input into a text bow is going to be a string rather than a number, ( "5" is not the same as 5), you might have a problem. Flash attempts to deal with any variable value you give it so it should be able to automatically convert a string to a number, but be aware that there might be a problem.

Your code should probably look something like:

if(input <= 5){ //input being the variable name of the input box
CODE HERE //the code for whatever the movie's supposed to do
}
else{
_root.buttonName._visible = false; //_root.buttonName being the path to the button
}

cheers