# Adding sound

**URL:** <https://forum.kirupa.com/t/adding-sound/312664>\
**Category:** Uncategorized\
**Created:** [August 10, 2010, 6:54am UTC](https://forum.kirupa.com/t/adding-sound/312664 "2010-08-10T06:54:24Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![abhin88](https://avatars.discourse-cdn.com/v4/letter/a/8491ac/32.png) [@abhin88](https://forum.kirupa.com/u/abhin88)\
**Post date:** [August 10, 2010, 6:54am UTC](https://forum.kirupa.com/t/adding-sound/312664/1 "2010-08-10T06:54:24Z")

</div>

Hi all , I am trying to add a sound to the LineTo() method. Inside a function I draw the Line and immediately call the Sound file. Here is the code, Is this right ? (jus giving the function here )

function leaderRT(e:MouseEvent){  
if(flag) {  
graphics.lineStyle(1, 0xCC00FF);  
graphics.lineTo(e.localX,e.localY);  
var sound:Sound= new Sound();  
sound.load(new URLRequest(“Swoosh.wav”));  
sound.play();  
}

I want the sound to be played until the line is drawn. Wat modification has to be done ? Also when I execute the above file I get the Stream error ? solutions ?
