Tema: swf externos
Ver Mensaje Individual
  #4 (permalink)  
Antiguo 20/10/2010, 14:45
Avatar de Diegoazul
Diegoazul
 
Fecha de Ingreso: mayo-2007
Ubicación: { Dash Berlin }
Mensajes: 1.879
Antigüedad: 17 años
Puntos: 67
Respuesta: swf externos

intenta con esta función:


Cita:
function cargar(ruta:String)
{
if (contenedor.numChildren > 1)
{
//
var l:int = contenedor.numChildren - 1;
for (var j:int = l; j >= 0; j--)
{
//

contenedor.removeChildAt(j);
}

}

//
var loader:Loader =new Loader();
//
loader.load(new URLRequest(ruta));
loader.contentLoaderInfo.addEventListener( Event.COMPLETE, completo );
//;
function completo( event:Event ):void
{


contenedor.addChild(loader);

}

}
y asi la llamas con un botón :
Cita:
boton_btn.addEventListener(MouseEvent.CLICK,botonP ulsado);
function botonPulsado(e:MouseEvent):void
{

cargar("miswf.swf");

}
__________________
{ Flash }