Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Random Selections

Status
Not open for further replies.

rissac

Technical User
May 9, 2003
79
IN
I've acquired a project for 2-6 yr old kids that require random selects. Here is the break down. In my project the user has to click the proper selection ( a scene with different items in a room) according to that the audio clip, for example if the audio click said "Please select the clock" (image a cloack on a wall), well if you select the clock , the next audio click is chosen randomly but is in the category of positive feed back for example ("That's Right" or "Good Job" or "You’re Good"). So the positive feed back will be positive but random. Now if the user does not click the clock but another object, then there will be negative feed back but random as well, ("Try again" or "You’re Close" or "You almost got it"). How in Director how would you have this done where the audio clips play randomly according to the appropriate category (Positive or Negative feed back)? Would this be done with variables or some kind of “if, then” statement or some other way? I’m stump on how to get this to work.

Serge Eustache
 
random() function returns random number. Therefore if you want to play either of 3 sounds, you would do:
--
puppetSound 1, ["That's Right", "Good Job", "You’re Good"][random(3)]
--
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top