# Random display letter from array

**URL:** <https://forum.kirupa.com/t/random-display-letter-from-array/203204>\
**Category:** Uncategorized\
**Created:** [October 9, 2006, 2:03am UTC](https://forum.kirupa.com/t/random-display-letter-from-array/203204 "2006-10-09T02:03:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![pixeldude](https://avatars.discourse-cdn.com/v4/letter/p/57b2e6/32.png) [@pixeldude](https://forum.kirupa.com/u/pixeldude)\
**Post date:** [October 9, 2006, 2:03am UTC](https://forum.kirupa.com/t/random-display-letter-from-array/203204/1 "2006-10-09T02:03:36Z")

</div>

Hi…

Okay I just have a quick question is it possible to randomly display letter store in array to attach MC…Meaning that…let’s say if I have value store in array like this…

```auto

var letterArray = ["n","e","w","s","p","a","p","e","r'];

```

then I do manage attach the mc based on the array length…with display in order like ’ **n e w s p a p e r** ’ but is it possible to display the letter randomly like eg; ’ **p e r s w a n e p** ’ and here’s are the attempt code…hope someone will give me some shed on light…

```auto

stop();

var letterArray:Array = [];

theString = "newspaper";
letterArray = this.theString.split("");
//create holder
this.createEmptyMovieClip("holderdragger",1);
this.createEmptyMovieClip("holdertarget",2);

//attach dragger to stage
for(var i=0;i<letterArray.length;i++){
    var dragger = holderdragger.attachMovie("dragger","dragger"+i,100+i);
	trace(dragger);
    dragger._x = 10+dragger._width*i;
    dragger._y = 300;
	dragger.theLabel.text = letterArray*;
}

//attach target to stage
for(var j=0;j<letterArray.length;j++){
    var target = holdertarget.attachMovie("target","target"+j,200+j);
	trace(target);
    target._x = 10+target._width*j;
    target._y = 100;
}

```

tq in advanced
