# onLoad -attachSound question

**URL:** <https://forum.kirupa.com/t/onload-attachsound-question/280696>\
**Category:** flash\
**Created:** [January 30, 2009, 2:14pm UTC](https://forum.kirupa.com/t/onload-attachsound-question/280696 "2009-01-30T14:14:46Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ralphiedee](https://avatars.discourse-cdn.com/v4/letter/r/ecccb3/32.png) [@ralphiedee](https://forum.kirupa.com/u/ralphiedee)\
**Post date:** [January 30, 2009, 2:14pm UTC](https://forum.kirupa.com/t/onload-attachsound-question/280696/1 "2009-01-30T14:14:46Z")

</div>

my main fla’s root timeline has two buttons  
first plays sound

on (release) {mainaudio = new Sound(this);  
mainaudio.attachSound(“plp\_clip”);  
mainaudio.start(0, 99);  
}

second stops sound

on (release) {mainaudio = new Sound(this);  
mainaudio.attachSound(“plp\_clip”);  
mainaudio.stop();  
}

they work fine

However, I need to have the sound (plp\_clip) automatically start playing when the movie starts and stop using the buttons as well. I tried some variations in code but can’t get it to work, too simple??

rderd
