# Array Exercise

**URL:** https://forum.kirupa.com/t/array-exercise/83329
**Category:** flash
**Created:** [March 17, 2005, 9:37pm UTC](https://forum.kirupa.com/t/array-exercise/83329 "2005-03-17T21:37:19Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![cki](https://avatars.discourse-cdn.com/v4/letter/c/85f322/32.png) [@cki](https://forum.kirupa.com/u/cki)
#### Post date: [March 17, 2005, 9:37pm UTC](https://forum.kirupa.com/t/array-exercise/83329/1 "2005-03-17T21:37:19Z")

</div>

```auto

//ARRAY TO STORE NAMES
var names = ["Alice", "Susan", "Jake", "Bill"];
//FOR LOOP TO GET KEYS OF NAMES ARRAY.
for (var i = 0; i<names.length; i++) {
	allNames = names;
	if (names* == "Bill") {
		names_txt.text = "Hello "+names*;
	} else {
		names_txt.text += names*+"
";
	}
}

```

In the above exercise I’m attempting if the name==“Bill” output hello + bill and the remaining names to the textfield  
ie.  
Alice  
Susan  
Jake  
Hello Bill  
But I’m only getting “Hello Bill” I also want the same results with any element in the array.

ie  
alice  
Hello Susan  
Jake  
Bill

What have I goofed?
