1 Reply Latest reply on May 4, 2006 11:40 PM by Newsgroup_User

    Lingo Illiterate

      ok i'm new to director and i'm only using it for this one class project, I need to know how to when an action happens director plays a randomly selected audio clip from an external file. If anyone knows how to do this I would greatly appreciate the help thanks
        • 1. Re: Lingo Illiterate
          Level 7
          Here's one approach

          Copy and paste names of sound files placed in same directory as the
          director file, into a director field member named "soundFileNames" (no
          empty line at end)

          then invoke this handler, which might be a movie script o wmbedded in a
          buton script like this example

          on mouseUp

          on randomSndFile
          sndList = member("soundFileNames").text
          sndName = sndList.line[random(sndList.line.count)]
          sound playFile the pathNAme & sndName


          Refinements could include:

          Handling sound files in folders apart from the director movie's location.

          Read sould file names directly out of the file system ( instead of
          stored list) using fileXtra4 or getNthfileinFolder lingo.

          Smart randomize that doesn't repeat a sound until all others have played.