Ya he solucionado ese problema, creo. Ahora el codigo no se "lee" hasta que no hago un ADD_TO_STAGE.
Pero despues me sigue dando el error
Código :
TypeError: Error #1010: Un término no está definido y no tiene propiedades.
at inicio_fla::MainTimeline/yaEsta()
at flash.display::DisplayObjectContainer/addChild()
at MethodInfo-5()
Me gustaria saber si no es posible acceder al nombre de instancia de un boton que esta en un swf, añadido con esta funcion:
Código ActionScript :
function carga_peliculas(laruta){
var ruta:URLRequest = new URLRequest(laruta);
var carga:Loader = new Loader();
carga.load(ruta);
carga.contentLoaderInfo.addEventListener(Event.COMPLETE, cargado);
function cargado(event:Event):void {
carga.addEventListener(Event.ADDED_TO_STAGE, yaEsta);
cargador.addChild(carga);
}
}
function yaEsta(e:Event):void {
cargador.volver.addEventListener(MouseEvent.CLICK, carga_pelicula);
function volver_pelicula(e:MouseEvent):void {
cargador.removeChildAt(0);
}
}
Gracias