This content has been marked as final. Show 4 replies
you can add your integers 0,...,images.length-1 to an array, shuffle() it and then retrieve array elements from the shuffled array:
I am looking to the future and trying to make this as dynamic as possible. what is going to happen in the future is an array will be populated from an XML and then from the new array i want a random 3 elements choosen to be displayed in my movie.
I am new to the dynamic part of flash. Am i going about this the wrong way?
Basically i need each of my 3 numbers to be a number from 0 to what ever my total number of movies is and none of them can be the same number.
The answer you need was provided.
If you do what kGlad suggested, you simply draw the first three elements from the shuffled array (ordered 'a' goes in, shuffled 'a' comes out)... there will be no repeats and they are randomly ordered each time you run the function.