14 Replies Latest reply on Dec 11, 2006 10:25 PM by JoeyJon

    Sound not playing

      Now, I made a music player for a website. When I tested (previewed) it in flash it did not play with sound. However, through the exterior swf player it played with sound as designed. So I uploaded it onto the server, and as you might guess it didn't work. It isn't part of the main .swf, the music player is loaded on a level above it. The weird thing is when I type in the .swf name into the browser, loading it by itself, the sound works. Can anyone help?
        • 1. Re: Sound not playing
          kglad Adobe Community Professional & MVP
          when you initialize your sound object, instead of using:

          • 2. Sound not playing
            JoeyJon Level 1
            that is what i'm using. any other ideas?

            note: other files that have worked in the past are now not working when a do the 'control > test movie' in flash. Is there a setting I may have changed to stop sound.?
            • 3. Re: Sound not playing
              albee Level 1
              When you load the music player into the main SWF, you're saying the sound plays locally but not online, or doesn't play at all? How are you incorporating sound? Embedded in the music player SWF? Defining sound objects and then loading MP3s directly with Sound.loadSound()? If so, try a Sound.onLoad() event handler to make sure all of you sound files are loaded before you attempt to start playing them.

              Also, it's always worth checking to make sure the files you are trying to load are MP3 files. Flash will embed MP3 or WAV files, but will only load MP3 files...

              Good luck,

              • 4. Re: Sound not playing
                JoeyJon Level 1
                ok. the site is www.benjaminsax.com.au then click fast connection. In the pop-up window you will see the music player, and then click the play button but no sound comes through. However, if you go www.benjaminsax.com.au/vw_audio.swf and then click play it works.
                • 5. Re: Sound not playing
                  albee Level 1
                  Based on a quick look at your site, I would say the problem has to do with the scope of your sound objects, but it's hard to say without looking at your code... Some quick tips:

                  1. Be conscious of where you are defining your sound objects:
                  var song1_sound = new Sound(target);
                  target needs to be a movie clip (it can refer to the clip where your sound is defined by using the this keyword). Where the sound object is defined and target both need to be kept track of

                  2. When you call the sound object, make sure you are referencing the correct scope. Say you defined your sound in the root movie clip but called it from a loaded movie clip. you would need to refer to it as _parent.song1_sound (if the loaded clip was a child of the root clip) or _root.song1_sound (make sure _lockroot property of loaded clip is undefined or false). Simply calling song1_sound will not work in this example.

                  3. Make sure enough of your sound has loaded before the player is activated, otherwise, you may hear nothing. Use the onLoad handler:
                  // define sound
                  var song1_sound = new Sound(this);
                  // define onLoad handler
                  song1_sound.onLoad = function(success) {
                  if (success) {
                  // activate player
                  // load sound; note that the false parameter means the sound is an event sound, not a streaming sound
                  song1_sound.loadSound("song1.mp3", false);

                  Good luck,

                  • 6. Re: Sound not playing
                    kglad Adobe Community Professional & MVP
                    what's changed from the past? were you publishing for flash mx when things worked?
                    • 7. Re: Sound not playing
                      JoeyJon Level 1
                      yeah everything is the same... same version (flash mx) and code. I just replaced the mp3. It's so strange. Now when I preview any of my files (from past) within flash aka control > test movie, there is no sound at all.
                      Thanks for taking the time to try and help me. Much appreciated, and i'll keep trying.
                      • 8. Re: Sound not playing
                        kglad Adobe Community Professional & MVP
                        retest with another mp3 to make sure it's not an mp3 issue.
                        • 9. Re: Sound not playing
                          JoeyJon Level 1
                          tried with multiple files and same thing happens.
                          It has to have something to do with the Levels I think. I re-built another player, and when i preview/test it in flash it works as planned. When I test the base file, and it is called into level 99, it appears fine but then when I click the play button no sound. the graphics for the play button work fine however. Is it possible there is a conflict due to the fact there are some sounds on the base level? Ive run out of ideas.
                          • 10. Re: Sound not playing
                            kglad Adobe Community Professional & MVP
                            there should be no-conflict because you used

                            new Sound(this)

                            to instantiate your sound in the external file. if you're not sure you did that, recheck it. failure to do so is the most common cause of the problem you originally described when the external file is loaded into a target movieclip.

                            if you're loading into a _level, there should be no conflicts.

                            copy and paste the code you use to load your external player swf and the code you used in your player that instanitates the sound, attaches the sound and starts the sound.
                            • 11. Sound not playing
                              JoeyJon Level 1

                              song1 = new Sound();
                              song1.onSoundComplete = function() {
                              sound_1.onRelease = function() {
                              song1.start(0, 3);
                              stop_sound.onRelease = function() {


                              loadMovieNum("VWInterface.swf", 250);

                              Thanks for persisting with me. Let me know if i'm doing something wrong.
                              • 12. Re: Sound not playing
                                kglad Adobe Community Professional & MVP
                                jeez. did you read my first message before you answered it? did you understand my first message?

                                if you think the answer is yes to the two questions above, then where is it that you did what you said you did? specifically, where is it that you used

                                new Sound(this);

                                instead of

                                new Sound()?
                                • 13. Re: Sound not playing
                                  kglad Adobe Community Professional & MVP
                                  and if you think you're frustrated as hell imagine how it feels to answer an op's question. but instead of paying attention to the suggested solution the op misleads everyone that's trying to help search for a problem that should have been resolved a few minutes after the op asked for help.
                                  • 14. Sound not playing
                                    JoeyJon Level 1
                                    Geez yourself. I tried your code correction immediately on reading it. With no success. If you had read all of my posts you would have realised I re-coded it in another attempt to fix it... hence I didnt have that code on it. Thanks chief anyway. I am only human. Sorry for wasting your time.