10 Replies Latest reply on Oct 22, 2009 5:57 PM by xrox2

    flash music replaying

    xrox2

      well i made a game and in the game there is music at the first frame and when u lose to goes back to first fram and more music plays so they are overlapping.

       

      How can i prevent this?

       

       

      thank,

      xrox2

        • 1. Re: flash music replaying
          Lon Winters Level 4

          The easiast way is to use the stopAllSounds(); command before the music starts playing again.

          • 2. Re: flash music replaying
            xrox2 Level 1

            well i still want the music to play but when you lose it goes back to the 1st rfam and thats where the music starts so there are 2 of the same music overlapping in diferent spots

            • 3. Re: flash music replaying
              xrox2 Level 1

              any one????

              • 4. Re: flash music replaying
                Lon Winters Level 4

                xrox2 wrote:

                 

                well i still want the music to play but when you lose it goes back to the 1st rfam and thats where the music starts so there are 2 of the same music overlapping in diferent spots

                 

                I think if you tried it, you would have found out that my previous suggestion would have worked.

                 

                 

                Place the command on a frame before the timline loops back to its starting point.  This will stop the original sound from playing, but it won't prevent the second iteration of the sound from playing.

                • 5. Re: flash music replaying
                  xrox2 Level 1

                  well then what happes is evry time it goes back to 1st frame the music stops but then wheni go to second from the music restarts (which i expected to happen.

                   

                  if there is any way i can have it not repeat or play only once it would be really helpful

                  • 6. Re: flash music replaying
                    Lon Winters Level 4

                    Can you zip your fla file and upload it here, if it's not too big?  I can't really tell what you have going on without looking at it.

                     

                    My suggestion involved a scenario which you may or may not be using:

                     

                    For example, on frame 1 you drop in your music file and it plays for say, 200 frames.  If the movie runs all 200 frames then starts over at frame one then the music will start over again.  But if something happens before frame 200, such as a button click on frame 150, that tells the movie to start over again at frame 1, then the original file will keep playing and the 2nd one will start, and overlap.

                     

                    So the question is, when it loops around, do you want the original song to keep playing and prevent the second iteraion from playing, or vice versa?

                    • 7. Re: flash music replaying
                      xrox2 Level 1

                      well i want the song to continue once it goes back to the 1st frame. here ill upload the FLA below.

                      • 8. Re: flash music replaying
                        xrox2 Level 1

                        here ill upload the FLA.

                         

                        i want it so that once it goes to the 1st frame it will continue the origanl song

                         

                        also thanks for all your help, even though you might not be able to help me i appreciate it

                        • 9. Re: flash music replaying
                          xrox2 Level 1

                          im not sure why but i cant upload FLA it doesnt let me.

                           

                          but i want to origanl music to play and them not to overlap.

                           

                          also i appreciate your help even though you might not find a solution

                          • 10. Re: flash music replaying
                            Lon Winters Level 4

                            Ok, there are a few different workaround you can do, but this is the first that comes to mind,  Are you familiar with any Actionscripting? You'll need a few lines of code.

                             

                            Basically, you need to define a variable that when it equals one value, the music file will play, and when it equals another value, then the file won't play.  For example, take the music off the main timeline, and place it in a movieclip with a stop action on frame 1 and the music file starting at frame 2.

                             

                            So if a certain condition is met, or not, it can tell that movie clip to start playing at frame 2.