Regarding Dynamic Text

Here it goes again…

user needs to key in two words “Fire”, “Water”…

When he enter “Fire”, the dynamic text will display "FIRE!!!’ in red color…

When he enter “Water”, the dynamic text will display “WATER!!!” in blue color…

I need only one dynamic text…

Thanks…:ne:

The dynamic text will display the word on a button press?

Yupz… You are right…

on (press) {
	tf = new TextFormat();
	if (input_txt.text == "Fire") {
		tf.color = 0x990000;
		dynamic_txt.text = "FIRE!!!";
	} else if (input_txt.text == "Water") {
		tf.color = 0x336699;
		dynamic_txt.text = "WATER!!!";
	}
	dynamic_txt.setTextFormat(tf);
}

var name for input box is input_txt

var name for dynamic box is dynamic_txt

it dont seems to work, can u post the .fla???

Nope they are both instance names for the textfields.

Hey it works fine again…:} _:}

:beam:

i would like to ask another thing… Hehe…

For example, there are two boxes to allow user to key in to label two angels, for example i label “B” and “Z”

after labelling i need to enter the angles : so it goes something like this “B60” and “Z90”…

Now the main problem here is that he needs to enter “B60” and “Z90”… if he enters something like “T60” or “F90”…It would be wrong as previous i already labelled them as “B” and “Z”…

Im not understanding what you want there… :-/

ok here i explain again…

in the first frame i let user label two angles, which he can use alphabet from “A-Z”… for this i have done it…

Now the problem is at second frame… i want to let the user enter the degrees for the two angels previously that i have labelled…

for example i labelled one angle as “A” and another angle as "B"
then when he enter the degrees for angle “A” and “B” …
He have the answer like this “A60” and “B70”…

if he enter “C60” and “D70”… it would be wrong as previously i have labelled the two angles as “A” and “B”…

Is that possible???

You just need to compare if the first letter matches?

i was just giving an example,
by right should be second character match…
thanks…

Compare myString.charAt(index) with the value that you previously saved.
ie:

my_value = "b";
if (user_value.charAt(1) == my_value) {
	//do something	
}

I dont understand the above codings… :-/ :puzzled:

//your value
my_value = "o";
//user value
user_value = "box";
//if the character at position 1(second letter) on user_value is equal to your_value
if (user_value.charAt(1) == my_value) {
	trace("match!");
	//outputs "match!"
}

Have to admit i am not good at this… :jail:
would u explain in fla format???

Just select a frame and paste that code on the actions panel.

hmm…do you know the previously the value "o’ need to be entered by user thenselves…?