-
1. Re: if statement
C-Rock Oct 15, 2010 7:39 AM (in response to Smitch1581)I would say the when the user enters the field, in other words the field has focus, I would start a timer.
That timer would check the field each half second or so for changes and then update what you need it to update. Then when the user leave
s the field and it loses focus kill the timer and listeners.
Help?
-
2. Re: if statement
Smitch1581 Oct 15, 2010 7:48 AM (in response to C-Rock)Hi
Thanx for the quick reply.
I'm trying to get it so when the user enters the Number 1 inside the sq TLF text field it goes to and stops on frame 2.
How can i control the condition statement within the parenthesis so that the sq text field is equal to 1?!
I hope thats a bit clearer?
thanx for your help so far
-
3. Re: if statement
C-Rock Oct 15, 2010 7:54 AM (in response to Smitch1581)You're probably comparing the string as text instead of a number. Remember all textfields contain strings so if you want them to be numbers you
have to convert them.
sq textfield contains the number 1 then the comparison looks like this
var sq_contents:Number = Number(sq.text);
if(sq_contents == 1){
// code here
}
-
4. Re: if statement
Smitch1581 Oct 15, 2010 8:15 AM (in response to C-Rock)Hi thanx fot taht, think could be getting there.
Is that what Flash calls casting?
I entered the code and it works if the text field has already has 1 typed in (i inputed 1 before i tested the movie), however, if the textfield is blank and i enter 1 in the exported swf nothing happens.!
Am i missing one last thing?
-
5. Re: if statement
Smitch1581 Oct 15, 2010 8:24 AM (in response to Smitch1581)Thank you, with your help i have just cracked it the code you submitted was
perfect, ignor the last post, my end goal was not that when the user enters 1 it goes to frame 2, i wanted the user to fill in the entire fields and then press a button, if they entered the correct number in all fields it would move to frame 2 so i wrapped the if statement in the button function and it worked treat.
Thank you very much again :-)
-


