AS2 Push appearing not to be working

baxters80 used Ask the Experts™
I have three existing arrays Option1, option2, option3
I am first trying to push the current record including option1, option2, and option3 into an array answers2 and then I randomize them and output array1, array2, array 3
I am performing a push so that they populate
The code is attached.I just cannot get this to work...
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Engineering Manager / Architect
Got a bit lost by your code so I did a small example of how to populate an array with data from another array and then randomizing it. Here's the code:

var array1:Array = [];
var options:Array = ["Value1", "Value2", "Value3", "Value4", "Value5"];


function populateAndRandomize():Void
	for(var i:Number = 0; i < options.length; i++)
	trace("Pre-randomize: " + array1);
	trace("Randomized: " + array1);

function RANDOM_SORT(a, b):Number
	return (Math.random() >= 0.5) ? 1 : -1;

Open in new window

Good luck!

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial