# Arrays assigned specific links

**URL:** <https://forum.kirupa.com/t/arrays-assigned-specific-links/207812>\
**Category:** Uncategorized\
**Created:** [November 21, 2006, 7:13pm UTC](https://forum.kirupa.com/t/arrays-assigned-specific-links/207812 "2006-11-21T19:13:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![hernga2](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/hernga2/32/3019_2.png) [@hernga2](https://forum.kirupa.com/u/hernga2)\
**Post date:** [November 21, 2006, 7:13pm UTC](https://forum.kirupa.com/t/arrays-assigned-specific-links/207812/1 "2006-11-21T19:13:16Z")

</div>

I have an array that generates a list of words that have links to site/page. but for some reason the URLs are being assigned randomly and i need to them to be specific to each word. Any suggestions? thanks.

```auto
// que of fill requests
fillRequests = new Array();
var vernacular = "Breakthrough Democracy Afghan Style Dwell DesignSource EndresWare Microsoft Darwin Min Day Nolo Now Rob Craigie Personal Science Squid Lab Instructables";

//links for words
links = ["http://www.breakthroughcollaborative.com","http://www.google.com","http://www.ask.com","http://www.yahoo.com","http://www.google.com","http://www.ask.com","http://www.yahoo.com","http://www.google.com","http://www.ask.com","http://www.yahoo.com","http://www.google.com","http://www.ask.com","http://www.yahoo.com","http://www.google.com","http://www.ask.com","http://www.yahoo.com","http://www.google.com","http://www.ask.com","http://www.yahoo.com","http://www.google.com"];

//array of words
wordList = new Array();
wordList = vernacular.split(" ");

// fill the page with words!
fillRegion(0,0,720,480);

this.onEnterFrame = function() {
	// pull fill requests from que and execute
	if (fillRequests.length>0) {
		freq = fillRequests.pop();
		fillRegion(freq.x0, freq.y0, freq.x1, freq.y1, freq.d);
	}
	

	
}

function fillRegion(x0, y0, x1, y1, d) {
	// pick one of the words and place
	n = random(wordList.length);
	word = wordList[n];
	ahref = links[n];
	trace(n+" "+ ahref + word)
	// place the word object
	nombre = "word"+String(depth++);
	neo = this.attachMovie("mcWord", nombre, depth);
	// set word
	neo.setWord(word);
	neo.fitInto(x0, y0, x1, y1, d);
}
function fillRegionRequest(x0, y0, x1, y1, d) {
	// request has been made to recursively fill a region
	// only allow if reasonable
	rWidth = x1-x0;
	rHeight = y1-y0;
	if ((rWidth>2) && (rHeight>2)) {
		addFillRequest(x0, y0, x1, y1, d+1);
// fillRegion(x0, y0, x1, y1, d+1);
	}
}
function addFillRequest(x0, y0, x1, y1, d) {
	// que up a request to fill a region
	var freq = {x0:x0, y0:y0, x1:x1, y1:y1, d:d};
	fillRequests.push(freq);
}

```
