# Dynamic txt and problem with AS

**URL:** https://forum.kirupa.com/t/dynamic-txt-and-problem-with-as/136570
**Category:** Uncategorized
**Created:** [February 6, 2005, 11:38am UTC](https://forum.kirupa.com/t/dynamic-txt-and-problem-with-as/136570 "2005-02-06T11:38:07Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![wickedBoy](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/wickedboy/32/1100_2.png) [@wickedBoy](https://forum.kirupa.com/u/wickedBoy)
#### Post date: [February 6, 2005, 11:38am UTC](https://forum.kirupa.com/t/dynamic-txt-and-problem-with-as/136570/1 "2005-02-06T11:38:07Z")

</div>

I’ve searched everywhere for a solution but cant seem to sort it out. I want 2 things.

Firstly, when an Mc hT \_root.target a dynamic txt states “Well Done!” (or similar).  
Secondly, when the Mc hT \_root.target, the score goes up by 5.

I’ve been working on these small scripts (with help from others) but as my AS skills are a bit shoddy, I don’t really knwo where to stick’em…Any ideas?  
This is the code I’m using:

```auto
_root.onEnterFrame = function () {
		for (x = 0; x<myArray.length;x++) {
			    if (_root.target.hitTest(_root["mc"+x])) {
					 if (_root.target._xscale < 150) {
							 _root.target._xscale += 5
							 _root.target._yscale += 5
							 _root["mc"+x].removeMovieClip()
					    }
				} else {
					 _root.isTarget(this)
				}
				
		}
}

```

this is the code I’m trying to attach…

```auto
if (_root.target.hitTest(_root["mc"+x])) {
	  _root.result="That good!";
	} else {
	  _root.isTarget(this)
	}

```

I’m really annoyed Ⓜabout this as it’s supposed to be straight forward! (sorry to sound like a spoilt brat 🅱, but it’s annoying isn’t it?)
