All of what weve done so far is just setup; now we just need to add the script that does the real work. This script goes on frame 2 of the movie clip:
fortunevar=Math.ceil(Math.random()*3) ;
if (fortunevar==1){
_root.fortune.fortunetext.fortunedisplay.text="Your " + _root.noun1 + " will " + _root.adv + " " + _root.verb + " the " + _root.adj + " " + _root.noun2 + " " + _root.name + ".";
}
if (fortunevar==2){
(etc .I think you get the idea at this point, and Im low on space.)
This is, again, just like the Magic 8-ball in that it generates a random number between 0 and 1 using Math.random, rounds it to the next highest integer using Math.ceil, and then multiplies by the number of options to get a number anywhere between 1 and X (with X being how many options you have, 3 in my case). Then it uses if statements to check the value assigned to the random number generated, and when one tests as true, performs the function inside.
What Ive done is set up a concatenation of text plus variables, arranging the variables gathered from the input text boxes to fill in the blanks in standard sentences. For each set of variables, there are three possible outcomes for how the sentence will be arranged.


