# TypeError: Error #1006: charAt is not a function.(PLEASE HELP)

**URL:** https://forum.kirupa.com/t/typeerror-error-1006-charat-is-not-a-function-please-help/320671
**Category:** flash
**Created:** [March 29, 2011, 11:23pm UTC](https://forum.kirupa.com/t/typeerror-error-1006-charat-is-not-a-function-please-help/320671 "2011-03-29T23:23:35Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![XMAN93](https://avatars.discourse-cdn.com/v4/letter/x/cab0a1/32.png) [@XMAN93](https://forum.kirupa.com/u/XMAN93)
#### Post date: [March 29, 2011, 11:23pm UTC](https://forum.kirupa.com/t/typeerror-error-1006-charat-is-not-a-function-please-help/320671/1 "2011-03-29T23:23:35Z")

</div>

Ok I’m making a hang man app in AS3 and when I try to run or debug it I get this error.

TypeError: Error #1006: charAt is not a function.  
at Hangman\_fla::MainTimeline/loadingText()[Hangman\_fla.MainTimeline::frame1:93]  
at flash.events::EventDispatcher/dispatchEventFunction()  
at flash.events::EventDispatcher/dispatchEvent()  
at [flash.net](http://flash.net)::URLLoader/onComplete()

I’m not entirely sure what it all means since I’m extremely new to AS3. So can someone please help me. Also I pasted the code function that charAt is a part of below.

if(words.charAt(i)!= " ")  
{  
underline = new Underline();  
underline.x = tempText.x + tempText.width/3;  
underline.y = tempText.y + tempText.height/2 + 5;  
textContainer.addChild(underline);

```
	}
}
textContainer.x = stage.stageWidth / 2 - textContainer.width/2;

```

}

function guess(event:MouseEvent):void  
{  
var wordLC:String = randomWords.toLowerCase();  
if(guess\_txt.text != “”)  
{  
if(wordLC.indexOf(guess\_txt.text) != -1)  
{  
for (var i: uint = 0; i \< textFields.length; i++)  
{  
if(wordLC.charAt(i) == guess\_txt.text)  
{  
textFields\*.text = randomWords.charAt(i);  
numCorrect ++;  
if(numCorrect \>= totalLetters)  
{  
endGame(“You Win”);  
}  
}  
}  
}
