# Spaces between string generated menu

**URL:** <https://forum.kirupa.com/t/spaces-between-string-generated-menu/208495>\
**Category:** Uncategorized\
**Created:** [November 29, 2006, 11:54am UTC](https://forum.kirupa.com/t/spaces-between-string-generated-menu/208495 "2006-11-29T11:54:55Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![meerah](https://avatars.discourse-cdn.com/v4/letter/m/53a042/32.png) [@meerah](https://forum.kirupa.com/u/meerah)\
**Post date:** [November 29, 2006, 11:54am UTC](https://forum.kirupa.com/t/spaces-between-string-generated-menu/208495/1 "2006-11-29T11:54:55Z")

</div>

Hi,  
I am willing to generate a menu from set of randomly sorted strings …  
The problem is that my code does not generate adequate spaces between strings…  
Can anybody pls look at that code whats going on?  
Any help welcome

```auto

_root.init.onRelease = function() {
initiate();
};
menu = ["pepa", "z depa", "obrazy", "paintings", "performance", "show", "whoIs", "alias", "about"];
function initiate() {
loadedLength = 0;
menu.sort(function () {
return Math.floor(Math.random()*3)-1;
});
for (i=0; i<9; i++) {
lastLength = menu*.length +60
xPos = loadedLength;
ySpace = 10;
this.createTextField("field"+i, i, xPos, ySpace, 100, 25);
ref = this["field"+i];
ref.text = menu*;
loadedLength += lastLength;
}
}

```
