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!

How do you Randomly display images in Director?

Status
Not open for further replies.

bum

Programmer
Feb 5, 2001
2
US
I would like to use Director to create a simple menu screen that drills down to four to six different sections or chapters. Each section randomly displays images for a fixed length of time, i.e., image 1 comes up for 30 seconds, fades and image 2 comes up, fades, etc. I would like the sections to reference independent directories where the user can place his/her images in. In essence, there would be a directory for each section.

Is there anyone who could tell me how to get started on this or lend me some suggestions? I have Director version 6.0.

-bum
 
var listoffiles= []
repeat with x = 1 to 100000000
if getNthFileNameinFolder(the moviepath, x) <> &quot;&quot; then
add(listoffiles, getNthFileNameinFolder(the moviepath, x))
end if
end repeat

that generates a list of the files in the folder (replace moviepath with the folder your interested in)

then just do
member(&quot;thegraphicmemberyouuse&quot;).filename = listoffiles[random(listoffiles.count)]
note: code not tested, checked or syntex guaranteed correct, but it should get you started in the correct direction.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top