2 Replies Latest reply on May 9, 2007 3:33 PM by nudnic

    Problem with Sound.position

    nudnic
      I find that Sound.position does not reset to 0 when using Sound.loadSound(). It seems to continue with the last value. If a loaded sound is stopped at position 500. Starting the sound again plays the sound from 0 but position starts at 500?

      I have worked around this by making a new sound object when a loadedSound is stopped. Is there a better solution?
        • 1. Re: Problem with Sound.position
          abeall Level 3
          That's crazy, I've never seen that before. What SWF version, Flash Player version, and OS/broswer? Can you share the source?
          • 2. Re: Problem with Sound.position
            nudnic Level 1
            This is not an intermittent problem. This is how the Sound object works. I'm using Flash 8. It worked this way under Flash 7 also.

            Try it for yourself. Follow these steps:

            1) Make a new text field to display the position. Then make two buttons one to play and one to stop the sound.

            2) Make a Sound object

            3) Add an onEnterFrame function to the main timeline that puts the position of the sound in the field

            4) Set up the first button to call loadSound. Set up the second button to stop the sound.

            Test your movie. Click the first button, the sound starts to play and you will see the value of position in your text field.
            Click the second button. The sound stops and the field still shows the current value of position.

            Note this says that position doesn't get set to 0 when you stop your sound.

            Next click the first button to play your sound. Clicking this calls loadSound again which starts the audio from the beginning. But, the position displayed in the field doesn't start form 0. It continues from where it was last. If the sound gets to the end. The value stops increasing but the sound continues to play?