# Is this wrong ? \>\> attachSound in an array

**URL:** <https://forum.kirupa.com/t/is-this-wrong-attachsound-in-an-array/143576>\
**Category:** Uncategorized\
**Created:** [April 7, 2005, 2:24am UTC](https://forum.kirupa.com/t/is-this-wrong-attachsound-in-an-array/143576 "2005-04-07T02:24:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ellare](https://avatars.discourse-cdn.com/v4/letter/e/919ad9/32.png) [@ellare](https://forum.kirupa.com/u/ellare)\
**Post date:** [April 7, 2005, 2:24am UTC](https://forum.kirupa.com/t/is-this-wrong-attachsound-in-an-array/143576/1 "2005-04-07T02:24:36Z")

</div>

any thing wierd with this array script ?

its not working.

it is on frame one of root. and so is nextBtn.

nextBtn.onRelease = function() {  
filename =  
[“clips/apollo13.wav”,“clips/cosmicdebris.wav”,“clips/earth.wav”,“clips/prez4.wav”,“clips/smallstep.wav”,“clips/houston2.wav”,“clips/spaceship.wav”,“clips/culture.wav”,“clips/cassini.wav”,“clips/blackhole.wav”,“clips/cosmic114dings.wav”,“clips/go-flight2.wav”,“clips/H-rogerout2.wav”,“clips/OKsoundsfine2.wav”,“clips/pixonTV.wav”,“clips/liftoff2.wav”];  
i = filename.length;  
k = Math.floor(Math.random()\*i);

mysound = new Sound();  
mysound.attachSound(filename[k]);  
mysound.start();}
