Comunidad de diseño web y desarrollo en internet online

Borrar movieclips

Citar            
MensajeEscrito el 11 Jun 2008 11:45 am
Hola, tengo un problema, si entrais en http://www.natalbaby.net/web/ en el apartado productos me trae los productos, el problema es que no se como decirle que cuando selecciones otra familia borre los movieclips attachados y me añada los nuevos. El codigo es el siguiente:

_root.attachMovie("cargas", "cargas", 90);
_root.productos.cargas._x = 300;
_root.productos.cargas._y = 10;
var xml:XML = new XML();
xml.ignoreWhite = true;
var numeroHijos:Number = new Number();
var productosAbuscar:LoadVars = new LoadVars();
_root.productos.attachMovie("mascara", "mascara", _root.getNextHighestDepth());
_root.productos.cargas.setMask(_root.productos.mascara);
_root.productos.mascara._x = 300;
_root.productos.mascara._y = 10;
function cargarProductos(familia:String) {
_root.productos.tituloFamilia_txt.htmlText = "<b>"+familia+"</b>";
productosAbuscar.familia = familia;
trace (productosAbuscar.familia)
productosAbuscar.sendAndLoad(direccionWeb+"productosAbuscar.php", productosAbuscar, "POST");
productosAbuscar.onLoad = function() {
xml.parseXML(productosAbuscar.respuesta);
numeroHijos = xml.childNodes[0].childNodes.length;
for (i=0; i<numeroHijos; i++) {
var todosProductos:MovieClip = _root.productos.cargas.attachMovie("cajaPro", "cajaPro"+i, 100+i);
todosProductos._y = 185 * i;
if (xml.childNodes[0].childNodes[i].childNodes[3].firstChild.toString() == null) {
todosProductos.nombre_txt.htmlText = "";
} else {
todosProductos.nombre_txt.htmlText = xml.childNodes[0].childNodes[i].childNodes[3].firstChild.toString();
}
todosProductos.img.loadMovie(direccionWeb+"img/3_"+xml.childNodes[0].childNodes[i].childNodes[6].firstChild.toString()+"");
todosProductos.referencia_txt.htmlText ="<b>Ref: </b>"+ xml.childNodes[0].childNodes[i].childNodes[1].firstChild ;
todosProductos.descripcion_txt.htmlText ="<b>Descripción: </b>"+ xml.childNodes[0].childNodes[i].childNodes[4].firstChild;
todosProductos.precio_txt.htmlText ="<b>P.V.P.: </b>"+ xml.childNodes[0].childNodes[i].childNodes[5].firstChild+"€";
todosProductos.onRelease = function() {
//Funcion a crear
};
}
altoSombra = _root.productos.mascara._height-_root.productos.cargas._height;
};
}
altoSombra = _root.productos.mascara._height-_root.productos.cargas._height;
_root.productos.arriba.onRollOver = function() {
this.onEnterFrame = function() {
if (_root.productos.cargas._y<=5) {
_root.productos.cargas._y += 5;
}
};
};
_root.productos.arriba.onRelease = function() {
if (_root.productos.cargas._y<=5) {
_root.productos.cargas._y += 20;
}
};
_root.productos.arriba.onRollOut = function() {
delete this.onEnterFrame;
};
_root.productos.arriba.onDragOut = function() {
delete this.onEnterFrame;
};

_root.productos.abajo.onRollOver = function() {
this.onEnterFrame = function() {
if (_root.productos.cargas._y>=altoSombra) {
_root.productos.cargas._y -= 5;
}
};
_root.productos.abajo.onRelease = function() {
if (_root.productos.cargas._y>=altoSombra) {
_root.productos.cargas._y -= 20;
}
};
_root.productos.abajo.onRollOut = function() {
delete this.onEnterFrame;
};
_root.productos.abajo.onDragOut = function() {
delete this.onEnterFrame;
};
_root.productos.arriba1.onRollOver = function() {
this.onEnterFrame = function() {
if (_root.productos.cargas._y<=5) {
_root.productos.cargas._y += 5;
}
};
};
_root.productos.arriba1.onRelease = function() {
if (_root.productos.cargas._y<=5) {
_root.productos.cargas._y += 20;
}
};
_root.productos.arriba1.onRollOut = function() {
delete this.onEnterFrame;
};
_root.productos.arriba1.onDragOut = function() {
delete this.onEnterFrame;
};
};
cargarProductos("Peleles");
_root.productos.faldones_btn.fondo._visible = false
_root.productos.faldones_btn.titulo_txt.htmlText = "<b>Faldones</b>"
_root.productos.envolturas_btn.fondo._visible = false
_root.productos.envolturas_btn.titulo_txt.htmlText = "<b>Envolturas</b>"
_root.productos.vestidos_btn.fondo._visible = false
_root.productos.vestidos_btn.titulo_txt.htmlText = "<b>Vestidos</b>"
_root.productos.peleles_btn.fondo._visible = false
_root.productos.peleles_btn.titulo_txt.htmlText = "<b>Peleles</b>"
_root.productos.conjuntos_btn.fondo._visible = false
_root.productos.conjuntos_btn.titulo_txt.htmlText = "<b>Conjuntos</b>"
_root.productos.camisas_btn.fondo._visible = false
_root.productos.camisas_btn.titulo_txt.htmlText = "<b>Camisas</b>"
_root.productos.pantalones_btn.fondo._visible = false
_root.productos.pantalones_btn.titulo_txt.htmlText = "<b>Pantalones</b>"
_root.productos.abrigos_btn.fondo._visible = false
_root.productos.abrigos_btn.titulo_txt.htmlText = "<b>Abrigos</b>"
_root.productos.faldones_btn.onRelease = function (){
cargarProductos("Faldones");
}
_root.productos.envolturas_btn.onRelease = function (){
cargarProductos("Envolturas");
}
_root.productos.vestidos_btn.onRelease = function (){
cargarProductos("Vestidos");
}
_root.productos.peleles_btn.onRelease = function (){
cargarProductos("Peleles");
}
_root.productos.conjuntos_btn.onRelease = function (){
cargarProductos("Conjuntos");
}
_root.productos.camisas_btn.onRelease = function (){
cargarProductos("Camisas");
}
_root.productos.pantalones_btn.onRelease = function (){
cargarProductos("Pantalones");
}
_root.productos.abrigos_btn.onRelease = function (){
cargarProductos("Abrigos");
}

Por Cubel

Claber

139 de clabLevel



Genero:Masculino  

Valencia, España

firefox
Citar            
MensajeEscrito el 11 Jun 2008 05:45 pm
Sugerencia: si focalizas donde está el problema, haces una hipótesis y pones solo el código relacionado con eso (10 líneas están bien) es probable que mas gente se interese por contestarte

Jorge

Por solisarg

BOFH

13669 de clabLevel

4 tutoriales
5 articulos

Genero:Masculino   Bastard Operators From Hell Premio_Secretos

Argentina

firefox
Citar            
MensajeEscrito el 11 Jun 2008 05:46 pm
... y por cierto, dale formato

Jorge

Por solisarg

BOFH

13669 de clabLevel

4 tutoriales
5 articulos

Genero:Masculino   Bastard Operators From Hell Premio_Secretos

Argentina

firefox

 

Cristalab BabyBlue v4 + V4 © 2011 Cristalab
Powered by ClabEngines v4, HTML5, love and ponies.