# Sound won't play?

**URL:** <https://forum.kirupa.com/t/sound-wont-play/45385>\
**Category:** Uncategorized\
**Created:** [March 13, 2004, 10:03pm UTC](https://forum.kirupa.com/t/sound-wont-play/45385 "2004-03-13T22:03:35Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![kathari](https://avatars.discourse-cdn.com/v4/letter/k/a183cd/32.png) [@kathari](https://forum.kirupa.com/u/kathari)\
**Post date:** [March 13, 2004, 10:03pm UTC](https://forum.kirupa.com/t/sound-wont-play/45385/1 "2004-03-13T22:03:35Z")

</div>

I am redoing quite a few buttons into mc’s to be able to get rid of the cursor changing into a handcursor. The buttons all have a sound on them onRollover. When I put the script on the mc’s instead, the sound doesn’t play.  
Here 's the code on the mc (on a separate layer)that holds all the buttons:  
[AS]this.createEmptyMovieClip(“butempty”, 1);  
myButmusic = new Sound(“butempty”);[/AS]  
and the code on the button/mc:  
[AS]onClipEvent (load) {  
this.useHandCursor=false;  
}  
on (rollOver) {  
setProperty(this, \_alpha, 0);  
myButmusic.attachSound(“but2”);  
myButmusic.setVolume(50);  
myButmusic.start(0.1);  
}  
on (rollOut) {  
setProperty(this, \_alpha, 100);  
}[/AS]  
I have changed the code to refer to “myButmusic” to abslolute (\_root.themenu.myButmusic.etc) I have tried the above code, I have tried parent, but nothing changes. the usehandcursor thing and the set Property work without problems.  
What am I doing wrong?:trout:

---

<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:** [March 13, 2004, 10:12pm UTC](https://forum.kirupa.com/t/sound-wont-play/45385/2 "2004-03-13T22:12:15Z")

</div>

> \*Originally posted by kathari \*  
> **I am redoing quite a few buttons into mc’s to be able to get rid of the cursor changing into a handcursor.**  
> Buttons also have the useHandCursor property.  
> \*Originally posted by kathari \*  
> \*\*

```auto
myButmusic.start(0.1);

```

\*\*  
This line has a typo. It should be

```auto
myButmusic.start(0 **,** 1);

```

---

<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:** [March 13, 2004, 10:15pm UTC](https://forum.kirupa.com/t/sound-wont-play/45385/3 "2004-03-13T22:15:38Z")

</div>

They do??? Great! It saves me A LOT OF time. i saw and fixed the typo already but it has nothing to do with it. i also realized that I missed out on an mc instance in the absolute target path but it doesn’t change anything!

---

<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:** [March 13, 2004, 10:21pm UTC](https://forum.kirupa.com/t/sound-wont-play/45385/4 "2004-03-13T22:21:45Z")

</div>

It could be a path problem. Can you tell me the movie structure and where is the code placed?  
Or attach your fla file.

---

<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:** [March 13, 2004, 10:28pm UTC](https://forum.kirupa.com/t/sound-wont-play/45385/5 "2004-03-13T22:28:41Z")

</div>

I guess so I just don’t understand it.  
he buttons/mcs are part of a menu(themenu) that sits on the main timeline. So the structure should be: \_root.themenu.butempty.mybutmusic.attachSound etc as far as I understand. butempty being the emptyMC created on the timeline of the menu (themenu). When I placed the code on buttons I had no problem at all just writing myButmusic.attachSound…

---

<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:** [March 13, 2004, 10:35pm UTC](https://forum.kirupa.com/t/sound-wont-play/45385/6 "2004-03-13T22:35:35Z")

</div>

Where is this code placed? In the main timeline or inside the butempty movieclip?

```auto
this.createEmptyMovieClip("butempty", 1);
myButmusic = new Sound("butempty");

```

---

<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:** [March 13, 2004, 10:38pm UTC](https://forum.kirupa.com/t/sound-wont-play/45385/7 "2004-03-13T22:38:56Z")

</div>

On the menu whose instancename is themenu, so… in between!

---

<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:** [March 13, 2004, 10:43pm UTC](https://forum.kirupa.com/t/sound-wont-play/45385/8 "2004-03-13T22:43:43Z")

</div>

Im assuming myButmusic is still a movieclip:

```auto
on (rollOver) {
        _parent.myButmusic.attachSound("but2");
        _parent.myButmusic.setVolume(50);
        _parent.myButmusic.start(0,1);
}
on (rollOut) {
        setProperty(this, _alpha, 100);
}

```

---

<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:** [March 13, 2004, 10:53pm UTC](https://forum.kirupa.com/t/sound-wont-play/45385/9 "2004-03-13T22:53:28Z")

</div>

No myButmusic is the mySound object and I tried doing it with parent. It doesn’t change anything. I amreally interested in knowing what I do wrong. i did (or started) this quite a while ago and remember having problems with it and fixing it by giving other names to the sound objects on a few mc’s that are there too. However you have really helped me enormously with the useHandCursor on buttons i fixed it in 30min instead of I don’t know how long(50 buttons…) so don’t bother about it if it’s a nuisance.  
THANKS anyway

---

<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:** [March 13, 2004, 10:54pm UTC](https://forum.kirupa.com/t/sound-wont-play/45385/10 "2004-03-13T22:54:24Z")

</div>

If you post your fla i can take a look into it.
