urgent help !!!!!!! a removeMovieClip ()

  • yazminv2
  • Born
  • Born
  • yazminv2
  • Posts: 2

Post 3+ Months Ago

someone who can help me !!!!!

I am trying to remove a movieclip that attach inside another MC receptor is physically placed in _root. I have tried to delete it but I do not work!!

I'm blocked and can not find the problem, someone help me!

PHP code is:

Code: [ Select ]

for(var i=0; i<arr_resultado.length; i++)
{    
    var mc_modelo:MovieClip = _root.mc_informacion.attachMovie("busqueda_desc","buscar_desc_"+ i,k);
    mc_modelo._x = 0;
    mc_modelo._y = coorY;
    mc_modelo.t_marca.text = arr_resultado[i][0];
    mc_modelo.t_modelo.text = arr_resultado[i][1];    
    mc_modelo.t_descripcion.text = arr_resultado[i][2];        
    k++;                        //Para el level del mc_modelo
    coorY =(coorY+28);            //cada 28 corta renglon


    mc_avance.onRelease = function(){
        k = (k + 300);
        _root.mc_informacion.removeMovieClip(this);

    }
}
  1. for(var i=0; i<arr_resultado.length; i++)
  2. {    
  3.     var mc_modelo:MovieClip = _root.mc_informacion.attachMovie("busqueda_desc","buscar_desc_"+ i,k);
  4.     mc_modelo._x = 0;
  5.     mc_modelo._y = coorY;
  6.     mc_modelo.t_marca.text = arr_resultado[i][0];
  7.     mc_modelo.t_modelo.text = arr_resultado[i][1];    
  8.     mc_modelo.t_descripcion.text = arr_resultado[i][2];        
  9.     k++;                        //Para el level del mc_modelo
  10.     coorY =(coorY+28);            //cada 28 corta renglon
  11.     mc_avance.onRelease = function(){
  12.         k = (k + 300);
  13.         _root.mc_informacion.removeMovieClip(this);
  14.     }
  15. }



I want to print the array data I have and when you move from the button above data are erased and new paint, but not erased and my butt all!

thought it might be the depth, but I've changed that point and as it stays the same!!


thanks

greetings
  • IceCold
  • Guru
  • Guru
  • User avatar
  • Posts: 1254
  • Loc: Ro

Post 3+ Months Ago

First, i don't know what is mc_avance.
Since it appears in a "for" loop, my best guess it's another button that you have outside the loop. So it's kind of odd.
You're using a button to remove what?
The "this" keyword inside a function represents the current movieclip, so in your case, "this" is equivalent to mc_avance, so basically you're trying to remove from mc_informatcion, the "mc_avance" movieclip, which doesn't exist there.

So my idea would be this: you create the mc_modelo movieclips, next create the mc_avance movieclips in the same loop, so for each mc_modelo you have a button to click on.
Something like
Code: [ Select ]
var mc_avance:MovieClip = _root.mc_informacion.attachMovie("button_id","button_"+ i,k);
k++; // do that or else it will erase the mc_informatcion movies
  1. var mc_avance:MovieClip = _root.mc_informacion.attachMovie("button_id","button_"+ i,k);
  2. k++; // do that or else it will erase the mc_informatcion movies

Then set: mc_avance.targetClip = mc_modelo;
and in the mc_avance.onRelease function, you go either by
_root.mc_informacion.removeMovieClip(this.targetClip);
or
this.targetClip._parent.removeMovieClip(this.targetClip);

I tend not to use _root reference, but it's your choice.
  • yazminv2
  • Born
  • Born
  • yazminv2
  • Posts: 2

Post 3+ Months Ago

hello thanks to help me,

Which I want to do is to show a list of objects Which can be 1 or 1000.

And I must put them of 13 in 13, the button "mc_avance" he is movieclip, and it makes the function look for the array (where this the information) the following 13 objects.

By them I need to clean the 13 previous objects.

I am using a MovieClip in screen that is called "mc_informacion" To which by means of code attach him another MovieClip which is "mc_modelos" and he is the one that repeats 13 times and there the information is printed.

My problem, is that all the results are printed to me, but they are printed overlapping itself.

For that reason I want to Eliminate the previous result, to see new the 13 objects that brings to me the Array.

Thanks
  • IceCold
  • Guru
  • Guru
  • User avatar
  • Posts: 1254
  • Loc: Ro

Post 3+ Months Ago

why didn't you start with what you want in the first place? :P
well, then your code should look like this:
Code: [ Select ]
for(var i=0; i<arr_resultado.length; i++)
{ .... // your code with attachMovie ... }

// now, mc_avance onRelease code is set outside the "for" loop
mc_avance.clipsCount = arr_resultado.length;
mc_avance.onRelease = function(){
    k = (k + 300);
    for(var i=0; i<this.clipsCount; i++)
    {  
     var mc_modelo:MovieClip = _root.mc_informacion["buscar_desc_"+ i];
     mc_modelo.removeMovieClip();
    }
}
  1. for(var i=0; i<arr_resultado.length; i++)
  2. { .... // your code with attachMovie ... }
  3. // now, mc_avance onRelease code is set outside the "for" loop
  4. mc_avance.clipsCount = arr_resultado.length;
  5. mc_avance.onRelease = function(){
  6.     k = (k + 300);
  7.     for(var i=0; i<this.clipsCount; i++)
  8.     {  
  9.      var mc_modelo:MovieClip = _root.mc_informacion["buscar_desc_"+ i];
  10.      mc_modelo.removeMovieClip();
  11.     }
  12. }

I think this should do it.

Post Information

  • Total Posts in this topic: 4 posts
  • Users browsing this forum: No registered users and 12 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.