# Anyone know how to double up a for loop in combo with an array?

**URL:** https://forum.kirupa.com/t/anyone-know-how-to-double-up-a-for-loop-in-combo-with-an-array/190780
**Category:** flash
**Created:** [June 14, 2006, 5:05pm UTC](https://forum.kirupa.com/t/anyone-know-how-to-double-up-a-for-loop-in-combo-with-an-array/190780 "2006-06-14T17:05:10Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![trevorsaint](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/trevorsaint/32/268_2.png) [@trevorsaint](https://forum.kirupa.com/u/trevorsaint)
#### Post date: [June 14, 2006, 5:05pm UTC](https://forum.kirupa.com/t/anyone-know-how-to-double-up-a-for-loop-in-combo-with-an-array/190780/1 "2006-06-14T17:05:10Z")

</div>

I need to use both arrays, can this be done in the same for loop.

code below:-

/_Store all my chartered areas in an array_/  
countries = new Array(“cr11”, “cr13”, “cr16”, “cr20”)  
captions = new Array(“morocco”, “this”, “that”, “here”)

//for (var i = 0; i \< countries.length; i++){

```php
for (var i = 0; i < countries.length; i++) {
	
		elements.worldmap[countries*].onRollOver = function() {
		elements.caption._visible = true;
		elements.caption.captiontext = captions[2]
		Mouse.hide()
		_root.x = 1;
		}

	    elements.worldmap[countries*].onRollOut = function() {
		elements.caption._visible = false;
		elements.caption.captiontext = ""
		Mouse.show()
		}
}

```
