load external swf and stop sound from previously loaded swf
Please excuse my potentially inelegant code.
I created a file that loads student animations via button click. They have sound and when the new swf loads the sound from the previous swf continues on top of the new
swf sound. I've tried solutions from various discussion threads but I am afraid my clumsy use of AS3 is impeding my efforts. I welcome suggestions.
var myLoader:Loader = new Loader();
loadItem1_btn.addEventListener(MouseEvent.CLICK, loadPic1);
loadItem2_btn.addEventListener(MouseEvent.CLICK, loadPic2);
function loadPic1(MouseEvent):void {
var myRequest:URLRequest=new URLRequest("Alejandro.swf");
myLoader.load(myRequest);
myLoader.x=200;
myLoader.y=150;
addChild(myLoader);
}
function loadPic2(MouseEvent):void {
var myRequest:URLRequest=new URLRequest("Hayley.swf");
myLoader.load(myRequest);
myLoader.x=200;
myLoader.y=150;
addChild(myLoader);
}
