Problem close external swf Actionscript 3
Hi .. I'm working on my project and I need help. I'm not an expert.
I have a main swf, and this one has several external swf (test1, test2)
I have menu and submenu, which load external swf.
Load well external swf.
Create the close button in the main swf, and close the external swf correctly.
THE PROBLEM is always visible the close button
I would like the close button to be visible only when loading the external swf. But always be hidden
I would prefer to place the close button on each of the external swf, is it possible ?.
Or does the close button have to be in the main swf?
thanks for your help
........................code................
import flash.events.MouseEvent;
ruta0_btn.removeEventListener(MouseEvent.ROLL_OVER, activar)
activador_mc.addEventListener(MouseEvent.ROLL_OVER, desactivar);
function desactivar (event:MouseEvent):void
{
gotoAndPlay("fuera");
}
import flash.display.Loader;
import flash.net.URLRequest;
var SWF:Loader = new Loader();
SWF.name = "holder"
/* Comienzo BOTON 1 */
ruta1_btn.addEventListener(MouseEvent.CLICK, fl_MouseClickHandler);
function fl_MouseClickHandler(event:MouseEvent):void
{
var ruta:URLRequest = new URLRequest ("images/test1.swf");
SWF.load(ruta);
SWF.contentLoaderInfo.addEventListener(Event.COMPLETE, añadir);
stage.frameRate = 50;
}
/* Fin BOTON 1 */
/* Comienzo BOTON 2 */
ruta2_btn.addEventListener(MouseEvent.CLICK, fl_MouseClickHandler_2);
function fl_MouseClickHandler_2(event:MouseEvent):void
{
var ruta:URLRequest = new URLRequest ("images/test2.swf");
SWF.load(ruta);
SWF.contentLoaderInfo.addEventListener(Event.COMPLETE, añadir)
stage.frameRate = 50;
}
/* Fin BOTON 2 */
function añadir (e:Event):void {
if(!this.getChildByName('holder')){
addChild(SWF);
SWF.x = -32;
SWF.y = -470;
}
}
/* CLOSE BUTTON */
borra_btn.addEventListener(MouseEvent.CLICK, borrarSWF);
function borrarSWF(event:MouseEvent):void {
removeChild(SWF);
}
