hola amigos. tengo un pequeño problema que al cargar un swf externo mediante un boton1 y si llamo otro swf desde otro swf desde boton2.... el swf que llame al principio queda abierto.. como podre cerrar los swf que ya abri.. adjunto el codigo que uso para 8 botones que cumplen la misma funcion
btnInicio.buttonMode = true;
btnbiogra.buttonMode = true;
btndisco.buttonMode = true;
btninteg.buttonMode = true;
btnlibro.buttonMode = true;
btngale.buttonMode = true;
btnvideo.buttonMode = true;
btncontac.buttonMode = true;
var btn1:Boolean = false;
var btn2:Boolean = false;
var btn3:Boolean = false;
var btn4:Boolean = false;
var btn5:Boolean = false;
var btn6:Boolean = false;
var btn7:Boolean = false;
var btn8:Boolean = false;
btnInicio.addEventListener(MouseEvent.ROLL_OVER, onMouseOverOut);
btnInicio.addEventListener(MouseEvent.ROLL_OUT, onMouseOverOut);
btnInicio.addEventListener(MouseEvent.CLICK, carga);
//CLICK
function carga(event:MouseEvent):void {
if (btn2) {
btnbiogra.gotoAndPlay("_out");
btn2 = false;
btnbiogra.addEventListener(MouseEvent.ROLL_OVER, onMouseOverOut);
btnbiogra.addEventListener(MouseEvent.ROLL_OUT, onMouseOverOut);
btnbiogra.addEventListener(MouseEvent.CLICK, carga1);
}
if (btn3) {
btndisco.gotoAndPlay("_out");
btn3 = false;
btndisco.addEventListener(MouseEvent.ROLL_OVER, onMouseOverOut);
btndisco.addEventListener(MouseEvent.ROLL_OUT, onMouseOverOut);
btndisco.addEventListener(MouseEvent.CLICK, carga2);
}
if (btn4) {
btninteg.gotoAndPlay("__out");
btn4 = false;
btninteg.addEventListener(MouseEvent.ROLL_OVER, onMouseOverOut);
btninteg.addEventListener(MouseEvent.ROLL_OUT, onMouseOverOut);
btninteg.addEventListener(MouseEvent.CLICK, carga3);
}
if (btn5) {
btnlibro.gotoAndPlay("_out");
btn5 = false;
btnlibro.addEventListener(MouseEvent.ROLL_OVER, onMouseOverOut);
btnlibro.addEventListener(MouseEvent.ROLL_OUT, onMouseOverOut);
btnlibro.addEventListener(MouseEvent.CLICK, carga4);
}
if (btn6) {
btngale.gotoAndPlay("_out");
btn6 = false;
btngale.addEventListener(MouseEvent.ROLL_OVER, onMouseOverOut);
btngale.addEventListener(MouseEvent.ROLL_OUT, onMouseOverOut);
btngale.addEventListener(MouseEvent.CLICK, carga5);
}
if (btn7) {
btnvideo.gotoAndPlay("_out");
btn7 = false;
btnvideo.addEventListener(MouseEvent.ROLL_OVER, onMouseOverOut);
btnvideo.addEventListener(MouseEvent.ROLL_OUT, onMouseOverOut);
btnvideo.addEventListener(MouseEvent.CLICK, carga6);
}
if (btn8) {
btncontac.gotoAndPlay("_out");
btn8 = false;
btncontac..addEventListener(MouseEvent.ROLL_OVER, onMouseOverOut);
btncontac..addEventListener(MouseEvent.ROLL_OUT, onMouseOverOut);
btncontac..addEventListener(MouseEvent.CLICK, carga7);
}
else (btn1 = false)
{
btnInicio.gotoAndPlay("_over");
btn1 = true;
var urlSwf:URLRequest = new URLRequest("rotatorias.swf");
var cargarSwf:Loader = new Loader();
cargarSwf.load(urlSwf);
this.addChild(cargarSwf);
btnInicio.removeEventListener(MouseEvent.ROLL_OVER , onMouseOverOut);
btnInicio.removeEventListener(MouseEvent.ROLL_OUT, onMouseOverOut);
btnInicio.removeEventListener(MouseEvent.CLICK, carga);
}
}
ese es el codigo que uso espero me puedan ayudar