Stuck on sound

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 ****??

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.

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?

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

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

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

could you attach your .fla? =)

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