# Regarding Dynamic Text

**URL:** https://forum.kirupa.com/t/regarding-dynamic-text/42272
**Category:** flash
**Created:** [February 7, 2004, 1:45am UTC](https://forum.kirupa.com/t/regarding-dynamic-text/42272 "2004-02-07T01:45:00Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![MaTilDA](https://avatars.discourse-cdn.com/v4/letter/m/b5ac83/32.png) [@MaTilDA](https://forum.kirupa.com/u/MaTilDA)
#### Post date: [February 7, 2004, 1:45am UTC](https://forum.kirupa.com/t/regarding-dynamic-text/42272/1 "2004-02-07T01:45:00Z")

</div>

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:

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 7, 2004, 3:55am UTC](https://forum.kirupa.com/t/regarding-dynamic-text/42272/2 "2004-02-07T03:55:24Z")

</div>

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

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 7, 2004, 3:56am UTC](https://forum.kirupa.com/t/regarding-dynamic-text/42272/3 "2004-02-07T03:56:30Z")

</div>

Yupz… You are right…

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 7, 2004, 4:12am UTC](https://forum.kirupa.com/t/regarding-dynamic-text/42272/4 "2004-02-07T04:12:02Z")

</div>

```auto
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);
}

```

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 7, 2004, 4:17am UTC](https://forum.kirupa.com/t/regarding-dynamic-text/42272/5 "2004-02-07T04:17:47Z")

</div>

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???

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 7, 2004, 4:18am UTC](https://forum.kirupa.com/t/regarding-dynamic-text/42272/6 "2004-02-07T04:18:28Z")

</div>

Nope they are both instance names for the textfields.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 7, 2004, 4:22am UTC](https://forum.kirupa.com/t/regarding-dynamic-text/42272/7 "2004-02-07T04:22:07Z")

</div>

Hey it works fine again…:} \_:}

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 7, 2004, 4:23am UTC](https://forum.kirupa.com/t/regarding-dynamic-text/42272/8 "2004-02-07T04:23:23Z")

</div>

:beam:

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 7, 2004, 4:34am UTC](https://forum.kirupa.com/t/regarding-dynamic-text/42272/9 "2004-02-07T04:34:23Z")

</div>

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”…

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 7, 2004, 4:44am UTC](https://forum.kirupa.com/t/regarding-dynamic-text/42272/10 "2004-02-07T04:44:43Z")

</div>

Im not understanding what you want there… :-/

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 7, 2004, 4:59am UTC](https://forum.kirupa.com/t/regarding-dynamic-text/42272/11 "2004-02-07T04:59:52Z")

</div>

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”…

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 9, 2004, 2:01am UTC](https://forum.kirupa.com/t/regarding-dynamic-text/42272/12 "2004-02-09T02:01:11Z")

</div>

Is that possible???

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 9, 2004, 3:40am UTC](https://forum.kirupa.com/t/regarding-dynamic-text/42272/13 "2004-02-09T03:40:00Z")

</div>

You just need to compare if the first letter matches?

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 9, 2004, 4:26am UTC](https://forum.kirupa.com/t/regarding-dynamic-text/42272/14 "2004-02-09T04:26:13Z")

</div>

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

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 9, 2004, 4:35am UTC](https://forum.kirupa.com/t/regarding-dynamic-text/42272/15 "2004-02-09T04:35:19Z")

</div>

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

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

```

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 9, 2004, 5:49am UTC](https://forum.kirupa.com/t/regarding-dynamic-text/42272/16 "2004-02-09T05:49:53Z")

</div>

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

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 9, 2004, 6:16am UTC](https://forum.kirupa.com/t/regarding-dynamic-text/42272/17 "2004-02-09T06:16:17Z")

</div>

```auto
//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!"
}

```

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 9, 2004, 6:19am UTC](https://forum.kirupa.com/t/regarding-dynamic-text/42272/18 "2004-02-09T06:19:50Z")

</div>

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

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 9, 2004, 6:21am UTC](https://forum.kirupa.com/t/regarding-dynamic-text/42272/19 "2004-02-09T06:21:30Z")

</div>

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

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 9, 2004, 6:30am UTC](https://forum.kirupa.com/t/regarding-dynamic-text/42272/20 "2004-02-09T06:30:42Z")

</div>

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

[Next page](https://forum.kirupa.com/t/regarding-dynamic-text/42272.md?page=2)
