# \[as\]loop out

**URL:** <https://forum.kirupa.com/t/as-loop-out/139151>\
**Category:** Uncategorized\
**Created:** [February 28, 2005, 11:56pm UTC](https://forum.kirupa.com/t/as-loop-out/139151 "2005-02-28T23:56:12Z")\
**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:** [February 28, 2005, 11:56pm UTC](https://forum.kirupa.com/t/as-loop-out/139151/1 "2005-02-28T23:56:12Z")

</div>

After discovering this php loop

```auto

//ARRAY LOOPING EXPERIMENT BASED ON FOUNDATION FLASH PHP SCRIPT.
/*
// Now we loop through each entry in our arrays looking for a valid match
    for ($count = 0; $count < count($usernames) && $matchFound == false; $count++) {

        // If username and password matches entry...
        if ($username == $usernames[$count] && $password == $passwords[$count]) {

            // Get the user's message and indicate we've found a match
            $message = $messages[$count];
            $matchFound = true;
        }
    } 
*/

```

I’m attempting to do the same with AS, running into undefined

```auto

matchfound = false;
var message = new Array("Fun", "Love", "Laugh");
var user = new Array("Alice", "Shelia", "Cathy");
var pass = new Array("Disco", "Tango", "Samba");
for (var i = 0; i<user.length && matchfound == false; i++) {
	if (users == user*&& password == pass*) {
	}
	trace(users*);
}

```

Can I do this?
