Ver Mensaje Individual
  #4 (permalink)  
Antiguo 14/04/2008, 16:59
exangel
 
Fecha de Ingreso: abril-2008
Mensajes: 613
Antigüedad: 16 años
Puntos: 22
Re: ¿Cómo conectar dos MovieClips externos?

A continuación te pongo el código. He alterado algún orden así como he BORRADO los EVENTOS onEnterFrame que molestaban más que otra cosa. No lo he probado porque para ello tendría que generar las otras películas y la estructura de CLIPS que tienes. El código:

var precargador_mc1:MovieClipLoader = new MovieClipLoader();
var precargador_mc2:MovieClipLoader = new MovieClipLoader();
var listener:Object = new Object();
var listener_2:Object = new Object();
listener.onLoadStart = function (target_mc) {
_root.attachMovie("ProgressBar","barra_mc", _root.getNextHighestDepth());
_root.barra_mc._y = 350;
_root.barra_mc._x = 650;
}
listener.onLoadProgress = function (target_mc, loadedBytes, totalBytes) {
var porcentaje:Number;
porcentaje = Math.round((loadedBytes*100)/totalBytes);
_root.barra_mc.gotoAndStop(porcentaje);
target_mc._visible = false;
target_mc.stop();
_root.barra_mc.numero_txt.text = porcentaje + " %";
}
listener.onLoadComplete = function (target_mc) {
_root.barra_mc.removeMovieClip();
target_mc._visible = true;
target_mc.play();
precargador_mc2.loadClip("header.swf", header_mc); //ESTO CARGA EL HEADER
delete listener
}
listener_2.onLoadStart = function (target_mc) {
_root.attachMovie("ProgressBar","barra_mc", _root.getNextHighestDepth());
_root.barra_mc._y = 350;
_root.barra_mc._x = 650;
}
listener_2.onLoadProgress = function (target_mc, loadedBytes, totalBytes) {
var porcentaje:Number;
porcentaje = Math.round((loadedBytes*100)/totalBytes);
_root.barra_mc.gotoAndStop(porcentaje);
target_mc._visible = false;
target_mc.stop();
_root.barra_mc.numero_txt.text = porcentaje + " %";
}
listener_2.onLoadComplete = function (target_mc) {
_root.barra_mc.removeMovieClip();
target_mc._visible = true;
target_mc.play();
delete listener_2
}

precargador_mc1.addListener(listener);
precargador_mc2.addListener(listener);
precargador_mc1.loadClip("contenido.swf", contenido_mc);