# Stuck on sound

**URL:** <https://forum.kirupa.com/t/stuck-on-sound/23210>\
**Category:** Uncategorized\
**Created:** [June 14, 2003, 7:21pm UTC](https://forum.kirupa.com/t/stuck-on-sound/23210 "2003-06-14T19:21:28Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![pspecial](https://avatars.discourse-cdn.com/v4/letter/p/3e96dc/32.png) [@pspecial](https://forum.kirupa.com/u/pspecial)\
**Post date:** [June 14, 2003, 7:21pm UTC](https://forum.kirupa.com/t/stuck-on-sound/23210/1 "2003-06-14T19:21:28Z")

</div>

I’m totally stuck on getting a sound to work in my movie. Here’s  
my code:

s = new Sound();  
s.attachSound(“hibee”);  
\_root.menu\_flyin.admin\_mc.onRollOver = function(){  
s.start();  
}

I created a test movie to see if there is someting wrong with the way I am scripting. But the test worked and my real movie doesn’t! AAARGH!!!

The sound is being targetted to a movie clip within a movie clip (\_root.menu\_flyin.admin\_mc) and all instances are there on the stage. I linked the “hibee” sound file to export to 1st frame for Actionscripting and all.

Seem like I’m doing everything right but obviously there’s something I’m missing

Any ideas where to begin troubleshooting this piece of \*\*\*\*??

---

<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:** [June 14, 2003, 7:29pm UTC](https://forum.kirupa.com/t/stuck-on-sound/23210/2 "2003-06-14T19:29:49Z")

</div>

Hmm, the test works, but your main movie does eh?

Does your main movie perhaps load in your test movie using loadMovie() or loadMovieNum()?

If so, then thats your problem, you’re targeting the \_root. Timelines are hierarchial, and when you load a movie into a main movie, the timeine hierarchy changes, and since the \_root is the very first timeline in the hierarchy, then the \_root is now the \_root of the main movie.

From the sound of it, this seems to be your problem, you will just have to change your targeting. Since I don’t know your setup I will go out on a limb and say using “this” (no quotes) instead of \_root might work.

---

<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:** [June 14, 2003, 8:15pm UTC](https://forum.kirupa.com/t/stuck-on-sound/23210/3 "2003-06-14T20:15:48Z")

</div>

Sorry to say “this” doesnt work.

My targets are on the maintimeline anyhow. And my path leads directly to the movie clip I’m applying the method to.

I’m perplexed.

I wonder if the problem stems from my target movie which already has some local handlers scripted…

on (rollOver) {  
\_root.menu\_movie.admin\_mc.gotoAndPlay(2);  
}  
on (rollOut) {  
\_root.menu\_movie.admin\_mc.gotoAndPlay(7);  
}  
on (release) {  
\_root.gotoAndPlay(“admin”);  
}

Is it not possible to have 2 of the same handlers in different locations? If not how would I attach the sound to the local script?

---

<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:** [June 15, 2003, 3:23am UTC](https://forum.kirupa.com/t/stuck-on-sound/23210/4 "2003-06-15T03:23:48Z")

</div>

you can have different onRollover handlers, but if one is in a clip nested inside the other, only the outer one will work

---

<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:** [June 15, 2003, 5:18am UTC](https://forum.kirupa.com/t/stuck-on-sound/23210/5 "2003-06-15T05:18:15Z")

</div>

Hmmm, seems like my poblem is the opposite. My nested script is working fine but the sound script on the main timeline is not.

---

<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:** [June 15, 2003, 5:41am UTC](https://forum.kirupa.com/t/stuck-on-sound/23210/6 "2003-06-15T05:41:56Z")

</div>

actually, i just tested it and i had no problems using both handlers.

could you attach your .fla? =)

---

<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:** [June 15, 2003, 5:40pm UTC](https://forum.kirupa.com/t/stuck-on-sound/23210/7 "2003-06-15T17:40:33Z")

</div>

Okay, I had to strip the movie down to get it to an acceptable size, however, I can’t seen attach it to this thread for some reason. I’ll open a new thread where I’ll attach the .fla. It’ll be called “stuck on sound 2”.

I did combine my test button whose sound works along with the movie clip that doesn’t. I only attached the sound to one button in the menu (instance: “admin\_btn”, 4th down).

Oddly enough, if I attach the sound to the entire menu instance it works. Must be something to do with how I’m nesting the script and/or movie clips.

Props up to anyone that can figure this one out
