This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > Flash Site Design > June 2005 > Sound file randomization





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Sound file randomization
OrionSin

2005-06-16, 11:24 pm

I have a website with a talking animated sequence. I want the sound files to be
random, meaning when the site loads, it randomly picks from a selection of
sound files to play. I was wondering if someone could point me in the right
direction. Would these be an actionscript in FLASH MX or an database function?

lander222

2005-06-24, 7:25 pm

the easiest way to do this seems te me to create an array in actionscript. Each
element of the array represents one filename. use the x =
math.round(math.random()*(y.length-1)) function. x will be an integer varying
from 0 to the length of the array -1 (because of the zero-indexing of an
array). then if your array is named y for example, with y[x] you just have
randomly chosen a filename(string) from the possibilities you have put in the
array. good luck

Sponsored Links


Copyright 2003 - 2008 forum4designers.com  Software forum  Computer Hardware reviews