2 Replies Latest reply on Apr 29, 2006 3:47 PM by Newsgroup_User

    emptying sound object

    pjjj
      im working on a site at www.trad-guitartuning.com, when im playing mp3 if move to another page which is on another frame sounds just keep randomly repeating im using the below script on a button to load mp3s in to a sound object eg six

      six.loadSound("notes/6d0_dadgad.mp3",false);

      the sound objects are defined on a frame in the main timeline

      six = new Sound(sixMc)

      is there a way to CLEAR, UNLOAD OR EMPTY A SOUND OBJECT IN FLASH
        • 1. Re: emptying sound object
          kglad Adobe Community Professional & MVP
          you can delete your sound object or assign it a null value AFTER downloading is complete. nothing (known to me) will stop an in-progress loadSound().
          • 2. Re: emptying sound object
            Level 7
            "pjjj" <webforumsuser@macromedia.com> wrote in message news:e2vulj$7ld$1@forums.macromedia.com...
            > im working on a site at www.trad-guitartuning.com, when im playing mp3 if move
            > to another page which is on another frame sounds just keep randomly repeating
            > im using the below script on a button to load mp3s in to a sound object eg six
            >
            > six.loadSound("notes/6d0_dadgad.mp3",false);
            >
            > the sound objects are defined on a frame in the main timeline
            >
            > six = new Sound(sixMc)
            >
            > is there a way to CLEAR, UNLOAD OR EMPTY A SOUND OBJECT IN FLASH

            You are playing the notes using setInterval. When you leave one section to play the other, you need to shut down those setInterval
            calls.
            To make it easier to clear them, change your soundIDs to _root.soundID. Then it can be cleared from anywhere.

            On the two scale selectors for Gmajor and Dmajor, stop all sounds when those are clicked, and clear the setInterval...

            on (release)
            {
            stopAllSounds();
            clearInterval(_root.soundID);
            _root.fretboard_mc.attachMovie("Dmaj_scale", "Dmaj_scale", "1");
            }

            (but first, go and change all the soundID references to _root.soundID)

            I looked at your files some time ago. That is why I know what it needs.
            tralfaz