This content has been marked as final. Show 10 replies
I didn't try to decipher what you did... when I see a while loop I start to cringe (they can be dangerous). If you have X questions and X answers:
that's not a good array randomizer because the first and last original array elements will tend to occur at the end of the randomized array more than you would expect if the original array were really randomized.
for the purposes of your quiz, nedwebs code might be good enough, but if you want to use something that's closer to randomizing your array you can use the following function to randomize any array:
I tried to locate kGlad's shuffle routine before I posted my version, but my search failed to find it... go with his. I guess I best copy it now for my own good.
i have a flash/resource folder that i store code bits that i find useful. that's where i store the shuffle function.
thanks for that
You don't know where I might find some code for a good analog clock timer? I've been trying to modify the code found at
but haven't much experience with "public" functions
[to kGlad] I've started doing the same thing... it's helpful when you continually see the same queries popping up.
[to fungus13] No, I haven't looked though. HAve you tried googling "Flash analog clock tutorial"
How do you think I found the code in the first place. It's controlling the clock out of standard time that is the problem. I may be able to figure it out, but implementing it in a "public" function is not so easy.
Hello... I am creating a quiz also. I have eight target containers, and I have eight small images (balloon, kite, etc...) wrapped in MCs.
I tried loading a random movie clip using this example here.
The example here - the one I used - grabs 1 random number - which I used to load a MC into a container such as:
I would like to do a few things beyond this. The most complex is instead of grabbing 1 random number of 3 I would like to grab 3 random numbers of 8 for loading three random image MCs. And I would like to grab three other random numbers of eight to define the random containers the random images will load into.
The stage is a grid of eight containers named 1 through 8. The main directory has eight MCs with images.
I want to load three different random movie clips over three seconds into three different random containers. Random clip 1 loads into a random container, one second later random clip 2 loads into a second random container (the first MC unloads as the second clip loads-up), one more second later random clip 3 loads into a random container. Then one more second later an enter frame clip event will reload the entire screen with a quiz MC.
So in short - three random clips are shown to the viewer over three seconds in three different containers - all random. Then they are presented with a screen that allows the user to think about what they saw for 8 seconds. After 8 seconds they are shown another MC that displays a random MC1 through 8 in a random container as the prompt. The viewer then selects a button - either YES or NO (Either the 4th random MC is one they actually saw (the balloon in the top right corner) during the three seconds of MCs they initially viewed or it was not (the balloon in the bottom left corner)). This information is sent to the db.
So what I am asking is this. If we can generate three random numbers from 1-8 to load the first three movies over three seconds into three random containers - and then can we compare the values of those image and container arrays with the value of the very last random numbers generated to load the 4th and last prompt quiz MC to determine if their is a match?
If their is are matches (a correct movie clip in the correct container) a YES would populate the db as "correct"! (ie, 1,4,7 compared to 4) If their is not a match a YES would populate the db as "incorrect" (ie, 1,4,7 compared to 2). If their is a match a NO would populate the db as "incorrect" (ie, 1,4,7 compared to 7). And lastly, if their is not a match a NO would populate the db as 'correct' (ie, 1,4,7 compared to 3).
Does my description make sense?
Can we find some help setting this up?
create an array of anything you want to randomize without repeats, apply the shuffle function and then access whatever number of objects you need.
Based on the Adobe link you showed, I couldn't rightly tell how you might have found it, but if you do a Google search on those keywords I mentioned, a number of different tutorials are listed, and the Adobe one isn't on the first page. The second one mentions that it is customizable.