Help Please

helo my name is Michael and i have problem with flash arrays
i need to place in the array letters from InputTextField
to count every one of them.
i need this fo Huffman algorithm i know that user put string like this
wwwwwwwwwaaaaaaaaaaaaaweeeeeeeeerrrrrrrr

and i need broke this string a part nad place every letter in array
but main problem is that when my_array = new Array(w,w,w,w)
i can’t take for dynamicTextField myDynamic_txt.text=my_array[0]
i get #undefine. I know that letters need to be in ’ ’ but i don’t know how tu put them in ‘’ ???
i know that trace(my_array[0]) works why?

_root.onEnterFrame=function()
{

input_str=myInput_txt.text;
my_str = input_str.split(""); 	// to split string ","
//w,w,w,w,w,w,w,w,w,w,w,e,e,e,e,e,e,e it works

my_array = new Array(input_str.length);

my_array.push="'"+my_str+"'";       // it doesn't work ;(
	
for(i=0;i<my_array.length;i++)
{
myDynamic_txt.text=my_array*;   // it doesn't work too 					  		  // ;(
}

}

i need to place in the array letters from InputTextField to count every one of them.

why don’t you just count the letters like this?:

input_str = myInput_txt.text;
numberOfLetters = input_str.length;

maybe this will do what you are looking for:


input_str = "Hello there.";
my_array = new Array();
for (var i = 0; i<input_str.length; i++) {
	my_array.push("'"+input_str.substr(i, 1)+"'");
}
trace(input_str);
trace(my_array);
trace(my_array.length);

Big Thanks it works :wink: