Groups | Blog | Home
all groups > flash actionscript > september 2006 >

flash actionscript : Gahering Data for Random Array


Angyl
9/12/2006 11:26:28 PM
I've searched the boards for help on this and doing so has taught me SOME of
what I need to do, but not all.

I think I can construct an array now, but what I need to know how to do is
GATHER the data for the array from user-inputted text, then have Flash return a
# of those inputs at random.

It's for drug screening. I need to be able to input Employee names (collected
by the array) and then enter the # of employees I want to have tested (say 6
out of 20 names entered). Then I want Flash to give me 6 of those names at
random without duplicating.

Like I said, from searching here, I think I learned how to build the array
using the dynamic text boxes. What I haven't seen is how to return X # of that
data to the user at random.

Any ideas?
Rothrock
9/13/2006 12:12:35 AM
Once you have an array, you can shuffle it and then just count off however many
elements you need.


http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?forumid=15&catid=28
8&threadid=1170742&highlight_key=y&keyword1=shuffle

Obviously I am partial to the one that I have posted about halfway down. :)

And it looks like blemmo has improved it at the end of this thread.


http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?forumid=15&catid=28
8&threadid=1039424&highlight_key=y&keyword1=shuffle

But I would still recommend including the ASSetPropFlag line from my post.
AddThis Social Bookmark Button