Como detener o borrar un xml

Hola mira el dia de ayer te hice una pregunta pero creo que no me explique bien.
Resulta que tengo una web en flash en la cual debo meter una galeria que funciona con .xml pero al momento de pasarme a otro fotograma o seccion de la pagina, la galeria sigue visible o sea que no se borra.
Esto es lo que hice: En el primer fotograma tengo todos los botones del menu, al presionar un boton del menu me lleva a la galeria (xml), pero si presiono el boton de regresar al inicio o si me voy a otra seccion de la pagina, la galeria se sigue viendo y lo que deseo es que al presionar otro boton la galeria se borre.
este es el codigo que utilice para la galeria:
utilizo dos fotogramas:
primer fotograma
MovieClip.prototype.addProperty("onLoad", function () {
 return __onLoadHandler__[this];
}, function (f) {
 if (__onLoadHandler__ == undefined) {
  _global.__onLoadHandler__ = {};
 }
 __onLoadHandler__[this] = f;
});
Math.easeInQuad = function(t, b, c, d) {
 return c*(t /= d)*t+b;
};
Math.easeOutQuad = function(t, b, c, d) {
 return -c*(t /= d)*(t-2)+b;
};
Stage.scaleMode = "noScale";
myXML = new XML();
myXML.ignoreWhite = true;
myXML.onLoad = function() {
 nodes = myXML.childNodes;
 // ----------------------
 // find first image
 // ----------------------
 if (topimage.length) {
  for (var i = 0; i<nodes.length; i++) {
   if (nodes.attributes.src == topimage) {
    var insert = nodes.slice(0, i);
    nodes.splice(0, i);
    nodes = nodes.concat(insert);
   }
  }
 }
 _root.gotoAndStop(4);
};
if (_url.indexOf("http")>-1) {
 myXML.load("gallery.php");
} else {
 myXML.load("gallery.xml");
}
stop();
Segundo fotograma (o sea el 4)
function drawOutline(mc, width, height) {
 var wallx = width/5+11;
 var wally = height/5+11;
 var offset = 0;
 // Shadow
 mc.beginFill(0x000000, 0);
 mc.moveTo(-wallx+offset, -wally+offset);
 mc.lineTo(wallx+offset, -wally+offset);
 mc.lineTo(wallx+offset, wally+offset);
 mc.lineTo(-wallx+offset, wally+offset);
 mc.lineTo(-wallx+offset, -wally+offset);
 // Outline
 mc.beginFill(0xFFFFFF, 0);
 mc.lineStyle(1, 0x333333, 0);
 mc.moveTo(-wallx, -wally);
 mc.lineTo(wallx, -wally);
 mc.lineTo(wallx, wally);
 mc.lineTo(-wallx, wally);
 mc.lineTo(-wallx, -wally);
 mc.endFill();
}
// ----------------------
// build placeholders
// ----------------------
loads = [];
stack = [];
depth = 9999;
for (i=0; i<nodes.length; i++) {
 attrs = nodes.attributes;
 img = _root.createEmptyMovieClip("image"+i, depth--);
 drawOutline(img, attrs.width, attrs.height);
 img.createEmptyMovieClip("imgholder", 1);
 img.imgholder._x = attrs.height/0.46;
 img.imgholder._y = attrs.height/1.1;
 img.imgholder.src = attrs.src;
 totalw += img._width;
 totalh += img._height;
 coverw = (img._width>coverw) ? Img._width : coverw;
 coverh = (img._height>coverh) ? Img._height : coverh;
 img._rotation = (Math.random()*2)-1;
 img._visible = true;
 img._alpha = 0;
 stack.push(img);
 loads.push(img);
}
stack[0]._rotation = 0;
gox = (totalw/nodes.length)*0.9;
goy = (-totalh/nodes.length)*0.4;
// ----------------------
// load images
// ----------------------
function loadimage(id) {
 if (loads[id]) {
  loads[id]._visible = true;
  loads[id].imgholder.loadMovie(loads[id].imgholder.src);
  loads[id].imgholder.onLoad = function() {
   loads[id].imgholder.onEnterFrame = function() {
    if (this._parent._alpha<75) {
     this._parent._alpha += 25;
    } else if (this._parent._alpha<100) {
     this._parent._alpha += 25;
     loadimage(id+1);
    } else {
     delete this.onEnterFrame;
    }
   };
  };
 }
}
loadimage(0);
// ----------------------
// handle swap
// ----------------------
_root.createEmptyMovieClip("Cover", 10000);
Cover.beginFill(0xFFFFFFF, 0);
_root.Cover._x = 200;
_root.Cover._y = 100;
Cover.moveTo(-coverw+300, -coverh+300);
Cover.lineTo(coverw+600, -coverh+300);
Cover.lineTo(coverw+600, coverh+300);
Cover.lineTo(-coverw+600, coverh+300);
Cover.lineTo(-coverw+600, -coverh+300);
Cover.endFill();
Cover.onRelease = function() {
 // Shuffle the top image to the side
 stack[0].t = 0;
 stack[0].rot = stack[0]._rotation;
 stack[0].changerot = (Math.random()*2)-1-stack[0].rot;
 stack[0].onEnterFrame = function() {
  this.t++;
  this._x = Math.easeInQuad(this.t, 0, gox, 6);
  this._y = Math.easeInQuad(this.t, 0, goy, 6);
  this._rotation = Math.easeInQuad(this.t, this.rot, this.changerot, 6);
  if (this.t == 7) {
   this.swapDepths(depth--);
   this.t = 0;
   this.onEnterFrame = function() {
    this.t++;
    this._x = Math.easeOutQuad(this.t, gox, -gox, 6);
    this._y = Math.easeOutQuad(this.t, goy, -goy, 6);
    if (this.t == 6) {
     delete this.onEnterFrame;
    }
   };
  }
 };
 // Rotate the next image into view
 stack[1]._x = stack[1]._y=0;
 stack[1].t = 0;
 stack[1].rot = stack[1]._rotation;
 stack[1].onEnterFrame = function() {
  this.t++;
  this._rotation = Math.easeOutQuad(this.t, this.rot, -this.rot, 6);
  if (this.t == 6) {
   delete this.onEnterFrame;
  }
 };
 // Move top image to the back of the stack array
 var addback = stack.shift();
 stack.push(addback);
};
.........Me podrias ayudar y hacer que se borre la galeria al momento de cambiarme de seccion?
Por favor
Te agradezco tu atencion.

1 respuesta

Respuesta
1
tu galeria se crea en level root, me imagino la mejor solucion es hacerla an un archivo externo galeria.fla, exporta este archivo como galeria.swf, y este archivo cargaras en tu pelicula padre dentro de movieclip o en un level mediante loadMovie("galeria.swf", level o mc);
para quitarla, usas simplemente unloadMovie(level o mc); o puedes hacer invisible tu mc, nombredemovieclip._visible=0;
Hola, te menciono que ya intente cargarla asi pero no me funciona.
Hice un archivo principal dentro del cual genere un movie clip con nombre de instancia galeria, el cual remplace de esta manera : loadMovie("galeria.swf", "galeria");
pero no me funciona bien ya que no aparecen las fotos solamente el fondo que yo le pongo a la galeria.fla, a que crees que se deba.
Agradezco tu atencion
Olvide escribirte, que tienes que repasar el codigo entero de la galeria y en cada parte dond epone _root tienes que andirle la cade de nombre de tu mc en este caso "galeria", entonces la sintaxis correcta para mc externo sera
_root.galeria.siguelalineadelcodigo...

Añade tu respuesta

Haz clic para o

Más respuestas relacionadas