# (fmx) Sound by actionscript

**URL:** https://forum.kirupa.com/t/fmx-sound-by-actionscript/26023
**Category:** flash
**Created:** [July 18, 2003, 4:59pm UTC](https://forum.kirupa.com/t/fmx-sound-by-actionscript/26023 "2003-07-18T16:59:53Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Suppi](https://avatars.discourse-cdn.com/v4/letter/s/2bfe46/32.png) [@Suppi](https://forum.kirupa.com/u/Suppi)
#### Post date: [July 18, 2003, 4:59pm UTC](https://forum.kirupa.com/t/fmx-sound-by-actionscript/26023/1 "2003-07-18T16:59:53Z")

</div>

Hello people,

I was wondering if it is possible to attach sound to a button by using pure actionscript. So I don’t mean the most common and easiest way by attaching the sound onto the frames of the button. What I do mean is the **opposite** of ‘StopAllSounds’ in :

[AS]  
on (rollOver) {  
gotoAndPlay(12);  
stopAllSounds();  
}  
[/AS]

Thank you for your time !

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [July 18, 2003, 5:21pm UTC](https://forum.kirupa.com/t/fmx-sound-by-actionscript/26023/2 "2003-07-18T17:21:42Z")

</div>

check this out;) . i think this will help you.  
[http://www.kirupa.com/developer/actionscript/sound.htm](http://www.kirupa.com/developer/actionscript/sound.htm)

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [July 18, 2003, 5:36pm UTC](https://forum.kirupa.com/t/fmx-sound-by-actionscript/26023/3 "2003-07-18T17:36:00Z")

</div>

now in this method the sound gets exported with the swf right???

and if so doesnt it make the file size igger???

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [July 18, 2003, 5:57pm UTC](https://forum.kirupa.com/t/fmx-sound-by-actionscript/26023/4 "2003-07-18T17:57:09Z")

</div>

Oh my, I went searching into the Flash MX articles and in my rush I forgot about the Actionscript…stupid me :crazy: !  
Anyway, that’s completely what I wanted to achieve, thank you for pointing me into that direction e.s.x.s.

In my opinion, file size doesn’t change at all. It is just the way how the sound starts that is explained.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [July 18, 2003, 8:12pm UTC](https://forum.kirupa.com/t/fmx-sound-by-actionscript/26023/5 "2003-07-18T20:12:03Z")

</div>

u r welcome Suppi 🙂
