AS2 and CS3 Multiple Sounds Playing

[FONT=Times New Roman][SIZE=3]This is my first time posting…had to read through a bit first. Would anyone with more experience controlling sounds using AS2 have advice to offer? I will try explain my situation:[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3] [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]I end up with sounds that won’t shut off in previous loaded .swf. Or the main theme song doubling on itself. Example: If the Family Reunions Button is the first button clicked, the mainThemeSong plays on top of itself. How do I stop this problem? (If it is played after another button it is ok.) Here is my code on the sub menu buttons of the HOME button (comments detail the problem):[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3] [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3] [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]

_root.mainMovie_mc.menu_mc.homeSub_mc.familyReunions_btn.onRelease = function() {[/SIZE][/FONT]
[SIZE=3][FONT=Times New Roman]            homePlaceholder._visible = true;[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]            _root.mainMovie_mc.homePic_mc._visible = false;[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]            _root.mainMovie_mc.award_btn._visible = false;[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]            _root.mainMovie_mc.pages._visible = true;[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]            _root.mainMovie_mc.gall.pics.pics._visible = false;[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]            _root.mainMovie_mc.gall.pics._visible = false;[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]            _root.mainMovie_mc.homeMessages_mc._visible = false;[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]            _root.mainMovie_mc.seasonalEffect_mc._visible = false;[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]            _root.mainMovie_mc.seasonalEffect2_mc._visible = false;[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]            _root.mainMovie_mc.developingScroll_mc._visible = false;[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]            _root.mainMovie_mc.pages.homePage_mc.bkgdGlow_mc._visible = false;[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]            loadMovie("Construction.swf", "homePlaceholder");[/FONT][/SIZE]
[FONT=Times New Roman][SIZE=3]//MainThemePaino is paused; position stored, and restarts correctly IF another button is played first[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]//MainThemePaino song starts on top of itself and two copies of the song are playing IF it is the first button pressed[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]//Sound is not playing and has not been paused[/SIZE][/FONT]
[SIZE=3][FONT=Times New Roman]            if (playing != true) {[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]                        if (paused != true) {[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]                                    playing = true;[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]                                    paused = false;[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]                                    stopped = false;[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]                                    myConditionText = "Playing";[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]                                    _root.mainMovie_mc.themeSong.start(0,999);[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]                        }[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]                        //Sound has been paused      [/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]                        if (paused == true) {[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]                                    playing = true;[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]                                    paused = false;[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]                                    stopped = false;[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]                                    _root.mainMovie_mc.themeSong.start(themeSongPosition,0);[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]                                    myConditionText = "Playing";[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]                                    _root.mainMovie_mc.themeSong.onSoundComplete = function() {[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]                                                _root.mainMovie_mc.themeSong.start("MainThemePaino");[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]                                    };[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]                        }[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]            }[/FONT][/SIZE]
[FONT=Times New Roman][SIZE=3]};[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3] [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]_root.mainMovie_mc.menu_mc.homeSub_mc.mMystry_btn.onRelease = function() {[/SIZE][/FONT]
[SIZE=3][FONT=Times New Roman]            homePlaceholder._visible = true;[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]            _root.mainMovie_mc.homePic_mc._visible = false;[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]            _root.mainMovie_mc.award_btn._visible = false;[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]            _root.mainMovie_mc.pages._visible = true;[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]            _root.mainMovie_mc.gall.pics.pics._visible = false;[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]            _root.mainMovie_mc.gall.pics._visible = false;[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]            _root.mainMovie_mc.homeMessages_mc._visible = false;[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]            _root.mainMovie_mc.seasonalEffect_mc._visible = false;[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]            _root.mainMovie_mc.seasonalEffect2_mc._visible = false;[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]            _root.mainMovie_mc.developingScroll_mc._visible = false;[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]            _root.mainMovie_mc.pages.homePage_mc.bkgdGlow_mc._visible = false;[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]            themeSongPosition = song.position/1000;[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]            if (pause != true) {[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]                        playing = false;[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]                        paused = true;[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]                        stopped = false;[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]                        myConditionText = "Paused";[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]                        themeSongPosition = _root.mainMovie_mc.themeSong.position/1000;[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]                        _root.mainMovie_mc.themeSong.stop("MainThemePaino");[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]                        loadMovie("MMystery.swf", "homePlaceholder");[/FONT][/SIZE]
[FONT=Times New Roman][SIZE=3]                        [/SIZE][/FONT]
[SIZE=3][FONT=Times New Roman]            }[/FONT][/SIZE]
[FONT=Times New Roman][SIZE=3]};[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3] [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3] [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]_root.mainMovie_mc.menu_mc.homeSub_mc.teaParty_btn.onRelease = function() {[/SIZE][/FONT]
[SIZE=3][FONT=Times New Roman]            homePlaceholder._visible = true;[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]            _root.mainMovie_mc.homePic_mc._visible = false;[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]            _root.mainMovie_mc.award_btn._visible = false;[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]            _root.mainMovie_mc.pages._visible = true;[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]            _root.mainMovie_mc.gall.pics.pics._visible = false;[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]            _root.mainMovie_mc.gall.pics._visible = false;[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]            _root.mainMovie_mc.homeMessages_mc._visible = false;[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]            _root.mainMovie_mc.seasonalEffect_mc._visible = false;[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]            _root.mainMovie_mc.seasonalEffect2_mc._visible = false;[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]            _root.mainMovie_mc.developingScroll_mc._visible = false;[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]            _root.mainMovie_mc.pages.homePage_mc.bkgdGlow_mc._visible = false;[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]            loadMovie("Construction.swf", "homePlaceholder");[/FONT][/SIZE]
[FONT=Times New Roman][SIZE=3]//MainThemePaino is paused; position stored, and restarts correctly IF another button is played first[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]//MainThemePaino song starts on top of itself and two copies of the song are playing IF it is the first button pressed[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]//Sound is not playing and has not been paused[/SIZE][/FONT]
[SIZE=3][FONT=Times New Roman]            if (playing != true) {[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]                        if (paused != true) {[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]                                    playing = true;[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]                                    paused = false;[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]                                    stopped = false;[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]                                    myConditionText = "Playing";[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]                                    _root.mainMovie_mc.themeSong.start(0,999);[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]                        }[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]                        //Sound has been paused      [/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]                        if (paused == true) {[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]                                    playing = true;[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]                                    paused = false;[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]                                    stopped = false;[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]                                    _root.mainMovie_mc.themeSong.start(themeSongPosition,0);[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]                                    myConditionText = "Playing";[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]                                    _root.mainMovie_mc.themeSong.onSoundComplete = function() {[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]                                                _root.mainMovie_mc.themeSong.start("MainThemePaino");[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]                                    };[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]                        }[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]            }[/FONT][/SIZE]
[FONT=Times New Roman][SIZE=3]};[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3] [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]_root.mainMovie_mc.menu_mc.homeSub_mc.weddings_btn.onRelease = function() {[/SIZE][/FONT]
[SIZE=3][FONT=Times New Roman]            homePlaceholder._visible = true;[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]            _root.mainMovie_mc.homePic_mc._visible = false;[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]            _root.mainMovie_mc.award_btn._visible = false;[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]            _root.mainMovie_mc.pages._visible = true;[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]            _root.mainMovie_mc.gall.pics.pics._visible = false;[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]            _root.mainMovie_mc.gall.pics._visible = false;[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]            _root.mainMovie_mc.homeMessages_mc._visible = false;[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]            _root.mainMovie_mc.seasonalEffect_mc._visible = false;[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]            _root.mainMovie_mc.seasonalEffect2_mc._visible = false;[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]            _root.mainMovie_mc.developingScroll_mc._visible = false;[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]            _root.mainMovie_mc.pages.homePage_mc.bkgdGlow_mc._visible = false;[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]            themeSongPosition = song.position/1000;[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]            if (pause != true) {[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]                        playing = false;[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]                        paused = true;[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]                        stopped = false;[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]                        myConditionText = "Paused";[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]                        themeSongPosition = _root.mainMovie_mc.themeSong.position/1000;[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]                        _root.mainMovie_mc.themeSong.stop("MainThemePaino");[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]                        loadMovie("Weddings.swf", "homePlaceholder");[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]            }[/FONT][/SIZE]
[FONT=Times New Roman][SIZE=3]};[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]

[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3] [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]On a different submenu button -inside the ABOUT main menu, the mainThemePaino song plays, but the sound in a previous loaded .swf continues anoyingly to play. How can correct this problem? (There is no problem if the viewer has used the close button on the imported external .swf, but so often one simply clicks one more button.) Then I have two sounds playing. I prefer not to use stopAllSounds, because the mainThemeSong pause is not correct then. The code here is:[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3] [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]

_root.mainMovie_mc.menu_mc.aboutSub_mc.thomasDavis_btn.onRelease = function() {[/SIZE][/FONT]
[SIZE=3][FONT=Times New Roman]            aboutPlaceholder._visible = true;[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]            _root.mainMovie_mc.homePic_mc._visible = false;[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]            _root.mainMovie_mc.award_btn._visible = false;[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]            _root.mainMovie_mc.gall.pics._visible = false;[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]            _root.mainMovie_mc.gall.pics.pics._visible = false;[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]            _root.mainMovie_mc.homeMessages_mc._visible = false;[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]            _root.mainMovie_mc.seasonalEffect_mc._visible = false;[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]            _root.mainMovie_mc.seasonalEffect2_mc._visible = false;[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]            _root.mainMovie_mc.developingScroll_mc._visible = false;[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]            _root.mainMovie_mc.pages.homePage_mc.bkgdGlow_mc._visible = false;[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]            loadMovie("WhoIsDavis.swf", "aboutPlaceholder");[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]            //Sound is not playing and has not been paused[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]            if (playing != true) {[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]                        if (paused != true) {[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]                                    playing = true;[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]                                    paused = false;[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]                                    stopped = false;[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]                                    myConditionText = "Playing";[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]                                    _root.mainMovie_mc.themeSong.start(0,999);[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]                        }[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]                        //Sound has been paused      [/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]                        if (paused == true) {[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]                                    playing = true;[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]                                    paused = false;[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]                                    stopped = false;[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]                                    _root.mainMovie_mc.themeSong.start(themeSongPosition,0);[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]                                    myConditionText = "Playing";[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]                                    _root.mainMovie_mc.themeSong.onSoundComplete = function() {[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]                                                _root.mainMovie_mc.themeSong.start("MainThemePaino");[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]                                    };[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]                        }[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]            }[/FONT][/SIZE]
[FONT=Times New Roman][SIZE=3]};[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3][/SIZE][/FONT] 
[FONT=Times New Roman][SIZE=3] [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]I hope I haven't missed related advice elsewhere on our forum.  I am much stumped on this.  As a newbie....many, many thanks in advance![/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3] [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]-Jeannie[/SIZE][/FONT]

Best I can suggest is to read a few of these tutorials:
http://www.kennybellew.com/tutorial/

Almost everything you want to know about sound can be found there. The ones on organising sounds, control independent sounds, troubleshoot sounds, and control all sounds globally are probably the most useful for you.

Thanks for the great lead. I have spent many an hour pouring over Kenny Bellew’s great Sound Object tutorial. I have gained much progress. Any chance you could help me with my next question?
[COLOR=black][/COLOR]
[COLOR=black] [/COLOR]
[COLOR=black]I am still using AS2, but have CS3.[/COLOR]
[COLOR=black] [/COLOR]
[COLOR=black]I would like to be able to control the external sounds better once loaded into my main movie. I have only succeeded in loading my external sounds successfully by using loadMovieNum on level1. And now my code to play only works if in the external .swf. Could you tell me what I am doing wrong? I am ok with it on this level if I can further control the sounds. My _root level has only the main movie preloader on it and then the entire movie in one movie clip(mainMovie_mc). So I have the levels correct for loading, but not for controlling the sounds I have loaded.[/COLOR]
[COLOR=black] [/COLOR]
[COLOR=black]Here is my code in the main movie to load the external sounds:[/COLOR]
[COLOR=black]

onClipEvent (load) {
 loadMovieNum("tcDavis_Sounds.swf", 1);
}
onClipEvent (enterFrame) {
 percentloaded = Math.floor(_level1.getBytesLoaded()/_level1.getBytesTotal()*100);
 percentdisplay = percentloaded+"%";
 if (percentloaded == 100 && !initialized) {
  _level1.themeSong();
  initialized = true;
  _visible = false;
 }
}

[/COLOR]
[COLOR=black] [/COLOR]
[COLOR=black]Here is my code in the main movie timeline trying to start the sounds from within the main movie:[/COLOR]
[COLOR=black]

_root.mainMovie_mc.themeSongVolume = 30;
_root.mainMovie_mc.themeSong.setVolume(themeSongVolume);
_global.themeSongPosition = 0;
_global.themeSongPositionPaused = 0;
_root.mainMovie_mc.themeSong.start(0,999);
_root.mainMovie_mc.themeSong.onSoundComplete = function() {
 _root.myConditionText = "Complete";
};

[/COLOR]
[COLOR=black] [/COLOR]
[COLOR=black]Would be so grateful for guidance! Would anyone have a corresponding .fla available to learn from? I was able to download all .fla used in the tutorials except for the one used in [FONT=Verdana]How to Preload Sound Objects that use the attachSound Method.[/FONT][/COLOR]