1 Reply Latest reply on Oct 5, 2007 8:45 AM by jl2000

    Sounds work sometimes

    jl2000 Level 1
      Hi -
      I used attachSound to add sounds to one of the swfs (topic 5) in my project. When testing the individual swf , everything worked great. But when testing the master.swf - entire project (which has 55 topics in it) the sounds I added to topic 5 didn't work.

      Can someone please give me a hint why it would work in the individual swf but not in the final project and how I can fix it?
      TIA your help.
      JL
        • 1. Sounds work sometimes
          jl2000 Level 1
          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.

          JL