Thema: Need a help
Einzelnen Beitrag anzeigen
  #1 (permalink)  
Alt 07-08-2019, 15:06
 Registrierter Benutzer
Links : Onlinestatus : Maxjade ist offline
Registriert seit: Aug 2019
Beiträge: 1
Maxjade befindet sich auf einem aufstrebenden Ast
Standard Need a help


in a for loop, after a PHP query, create multiple instances of a movie clip dynamically, all of which I put into a separate MC as a container, all of which can be quickly deleted.
But here is the problem. I just can not delete the instances and can not figure it out ...

HTML code:
var container: MovieClip = new MovieClip ();
addChild (container);
for (i = 1; i <= 15; i ++) {
ClassReference: Class = getDefinitionByName ("mc _" + ["field" + i]) as Class;
var instance: MovieClip = new ClassReference ();
instance.x = posx;
instance.y = posy;
container.addChild (instance);
The ad works wonderfully. The instances should now be deleted at the touch of a button, and the whole thing should start from the beginning ... but what does not work ... The new instances just superimpose tellpizzahut those before.
I tried removeChild (container), to no avail. Actually, I thought to myself, I just delete the whole container, create again a new one and fill it again with instances .... as I said, does not work. I just do not get the container deleted ... What am I doing wrong ???

Thanks in advance.

Geändert von Maxjade (07-08-2019 um 21:36 Uhr)
Mit Zitat antworten