# Dynamically create text then duplicate?

**URL:** <https://forum.kirupa.com/t/dynamically-create-text-then-duplicate/106862>\
**Category:** Uncategorized\
**Created:** [April 9, 2004, 4:49pm UTC](https://forum.kirupa.com/t/dynamically-create-text-then-duplicate/106862 "2004-04-09T16:49:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![lunatic](https://avatars.discourse-cdn.com/v4/letter/l/73ab20/32.png) [@lunatic](https://forum.kirupa.com/u/lunatic)\
**Post date:** [April 9, 2004, 4:49pm UTC](https://forum.kirupa.com/t/dynamically-create-text-then-duplicate/106862/1 "2004-04-09T16:49:50Z")

</div>

I am trying to use AS to create a hangman type game. I am wondering if it is possible to dynamically create a text field (mc.createTextField?) but then duplicate the mc that holds the text field?

I have this so far on the “submit” button (after user submits a letter):

```auto

on (release) {
	//evaluate if guess matches letter in word
	for (k=0; k<stringlen; k++) {
		if (guess == guessword.charAt(k)) {
			x = getProperty(_root.word["lines"+k], _x);
			y = getProperty(_root.word["lines"+k], _y);
			_root.createEmptyMovieClip("lettermc", 5);
			lettermc.createTextField("letters"+k, k+5, x, y, 10, 20);
			lettermc["letters"+k].text = guess;
			status.text = "Lucky guess!";
			guess = "";
		} else {
			status.text = "Try again!";
			guess = "";
		}
	}
}

```

This works but only for the first letter in the word. Also, even if I guess the first letter it appears but at 0,0 (instead of x, y) and status.text shows up as “Try again!” instead of “Lucky guess!”.

1. what do I need to fix
2. how can I duplicate the text field to print out more letters?

Thanks for any help!

p.s. I can upload the whole fla if that would help.
