# Randomizing Array data

**URL:** <https://forum.kirupa.com/t/randomizing-array-data/281616>\
**Category:** flash\
**Created:** [February 11, 2009, 10:37am UTC](https://forum.kirupa.com/t/randomizing-array-data/281616 "2009-02-11T10:37:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeancnicolas](https://avatars.discourse-cdn.com/v4/letter/j/7bcc69/32.png) [@jeancnicolas](https://forum.kirupa.com/u/jeancnicolas)\
**Post date:** [February 11, 2009, 10:37am UTC](https://forum.kirupa.com/t/randomizing-array-data/281616/1 "2009-02-11T10:37:49Z")

</div>

Hello,  
I’ve been putting data into an array via XML, and then selecting at random an image string to load in a pic at random.  
But whilst doing this, I wanted to remove the String from the Array that I have just used, so I don’t get repetition of the same image in the output. I initially thought that pop would remove the string I had just used - But of course it Removes the last value in the Array instead, which doesn’t really help.

Ok - so how about randomizing the data once inside the Array, after it has been pulled in from XML!? That way I can load in the ‘last’ image, and then pop it out! Keeping a randomized selection of images each time ‘it’ is loaded

I don’t know how to do that though!!  
Can anyone lay a helping hand…:bounce:
