Help Please! Movies play in background!
EGBAR.Mary Aug 25, 2011 3:02 PMHelp Please! I am very new at this. I have a random movie playing in a window and 6 buttons below-each plays its own movie when clicked. The problem is that as you clck around on the buttons, a movie plays in the background. I did get the sound to stop. I appreciate any help.
import flash.display.MovieClip;
import flash.events.MouseEvent;
//This is where the Stop Sound is
function fl_ClickToStopAllSounds(event:MouseEvent):void {
SoundMixer.stopAll();
}
var loader:Loader = new Loader(); //this variable will load the file
var movieList:Array = [ threePrinciples, newlyweds, automotive, manRap, boysToys, troopTradition];
var mc:MovieClip = getRandomMovie();
var buttonPrinciples:ButtonPrinciples = new ButtonPrinciples;
var buttonNewlyweds:ButtonNewlyweds = new ButtonNewlyweds;
var buttonManRap:ButtonManRap = new ButtonManRap;
var buttonBoysToys:ButtonBoysToys = new ButtonBoysToys;
var buttonAuto:ButtonAuto = new ButtonAuto;
var buttonTroops:ButtonTroops = new ButtonTroops;
//Play Random Movie in Main window
function getRandomMovie():MovieClip {
return new movieList[Math.floor(Math.random()*movieList.length)];
}
addChild(mc);
mc.x = 34;
mc.y = 38;
//Add Buttons below Main Window
addChild(buttonPrinciples);
buttonPrinciples.x=34;
buttonPrinciples.y=312;
buttonPrinciples.buttonMode = true;
addChild(buttonNewlyweds);
buttonNewlyweds.x=111.60;
buttonNewlyweds.y=312;
buttonNewlyweds.buttonMode = true;
addChild(buttonManRap);
buttonManRap.x=189.20;
buttonManRap.y=312;
buttonManRap.buttonMode = true;
addChild(buttonBoysToys);
buttonBoysToys.x=266.80;
buttonBoysToys.y=312;
buttonBoysToys.buttonMode = true;
addChild(buttonAuto);
buttonAuto.x=344.40;
buttonAuto.y=312;
buttonAuto.buttonMode = true;
addChild(buttonTroops);
buttonTroops.x=422;
buttonTroops.y=312;
buttonTroops.buttonMode = true;
//If the first button is clicked ThreePrinciples is replaces Random Movie
buttonPrinciples.addEventListener(MouseEvent.CLICK, button1Clicked);
function button1Clicked(event:MouseEvent):void {
removeChild:(movieList);
SoundMixer.stopAll();
var bruce:threePrinciples = new threePrinciples();
addChild(bruce);
bruce.x = 34;
bruce.y = 38;
//trace("button clicked");
}
//If the second button is clicked newlyweds replaces Random Movie
buttonNewlyweds.addEventListener(MouseEvent.CLICK, button2Clicked);
function button2Clicked(event:MouseEvent):void {
unloadMovie:(movieList);
SoundMixer.stopAll();
var newly:newlyweds = new newlyweds();
addChild(newly);
newly.x = 34;
newly.y = 38;
//trace("button clicked");
}
//If the third button is clicked manRap replaces Random Movie
buttonManRap.addEventListener(MouseEvent.CLICK, button3Clicked);
function button3Clicked(event:MouseEvent):void {
removeChild:(movieList);
SoundMixer.stopAll();
var rap:manRap = new manRap();
addChild(rap);
rap.x = 34;
rap.y = 38;
//trace("button clicked");
}
//If the fourth button is clicked boysToys replaces Random Movie
buttonBoysToys.addEventListener(MouseEvent.CLICK, button4Clicked);
function button4Clicked(event:MouseEvent):void {
removeChild:(movieList);
SoundMixer.stopAll();
var toys:boysToys = new boysToys();
addChild(toys);
toys.x = 34;
toys.y = 38;
//trace("button clicked");
}
//If the fifth button is clicked auto replaces Random Movie
buttonAuto.addEventListener(MouseEvent.CLICK, button5Clicked);
function button5Clicked(event:MouseEvent):void {
removeChild:(movieList);
SoundMixer.stopAll();
var auto:automotive = new automotive();
addChild(auto);
auto.x = 34;
auto.y = 38;
//trace("button clicked");
}
//If the sixth button is clicked troops replaces Random Movie
buttonTroops.addEventListener(MouseEvent.CLICK, button6Clicked);
function button6Clicked(event:MouseEvent):void {
removeChild:(movieList);
SoundMixer.stopAll();
var troops:troopTradition = new troopTradition();
addChild(troops);
troops.x = 34;
troops.y = 38;
//trace("button clicked");
}
var myFrame:emptyMC = new emptyMC();
addChild(myFrame);
myFrame.x = 33;
myFrame.y = 37;


