Thought my first blog post would be a quick little function I made a while ago. I had an array and needed to scramble it up, so I wrote this. Hopefully it’s of some help to someone!

//to use, simply make your array equal to the output
//example:
//var myArray:Array = ["foo", "boo", 1, 2 ,3];
//myArray = randomize(myArray)

		public function randomize(target:Array):Array
		{
			var randomizedArray:Array = [];
			var listData:*;
			while(target.length>0)
			{
				listData = target.splice(Math.floor(Math.random() * target.length), 1);
				randomizedArray.push(listData);	
			}

			return randomizedArray;
		}