This content has been marked as final. Show 1 reply
I solved this issue at the same time as another post. Here's that answer:
Like most of my AS - it is messy. I'm sure there is a better way to do this but here's what I have so far.
First I need to set the stage - forgive any repetition. My project is constructed starting with one swf that is only a preloader. The "Start.swf" is the first thing the user sees but they do not interact with it. The "Start.swf" then loads the main "master.swf" which is the overall GUI. From the master, the user navigates and loads in all other Topic swfs into itself.
That being established, what I've discovered is that all the sound files have to be in the Library of the Start.swf - not the master.swf - with the correct Linkage settings. Also in the actions layer of the Start.swf I used the above code to declare a var with the new Sound object, attachSound and also setVolume to 100. (I was only able to get the desired volume by editing the wav file outside of Flash - but that's another topic for the forum.) But it did not put the code in a named function as before.
Now to Topic5.swf . This is an "inner swf" that the user can access by clicking a link on the master GUI. It's the one with the 3 button instances that started this thread. As someone suggested I took the sound off of the timeline of the btns. I found that the wav (or mp3) file must also be in that Topic5.swf Library with the same Linkage ID as in the Start.swf (so I copied and pasted the snd files from one Library to the other).
Then in the movie clip within Topic5 that actually has the onRelease code for the buttons I want to hear I put your same code: declare a var with a new Sound object and attach it. I did not setVolume here. Then in the onRelease function statement of the button I put the start() . I found that the same worked for mcs that are used as btns.
That's my story and I'm sticking to it. I hope it helps someone...or at least doesn't hurt anyone.