# Random Audio funtion:

**URL:** <https://forum.kirupa.com/t/random-audio-funtion/125167>\
**Category:** Uncategorized\
**Created:** [October 11, 2004, 4:46am UTC](https://forum.kirupa.com/t/random-audio-funtion/125167 "2004-10-11T04:46:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![chockybickyman](https://avatars.discourse-cdn.com/v4/letter/c/7bcc69/32.png) [@chockybickyman](https://forum.kirupa.com/u/chockybickyman)\
**Post date:** [October 11, 2004, 4:46am UTC](https://forum.kirupa.com/t/random-audio-funtion/125167/1 "2004-10-11T04:46:51Z")

</div>

**I used a script like this to randomise a background graphic:**

function randomBg() {  
randFrame = random(3)+1;  
bg\_graphics.gotoAndStop(randFrame);  
}

**- What kind of script would u use to target sound objects in the library to play at random when the movie loads. Playing only one of the audio loops everytime the movie loads???**

**- I have already got this script on the onClipEvent load. Could this be used further, to refer to what i want to do above?**

mysoundobject = new Sound();  
mysoundobject.start(0, 1);
