View Full Version : delete all objects?
gimis
04-01-2003, 09:36 AM
is there anyway to delete all movieclips and textfields that were created using createTextField/createEmptyMovieclip. they are created using complicated loops and would be far easier if we could find a way to clear the lot when we want instead of having to go through the loops again deleting each object one at a time.
GIMIS team
CyanBlue
04-01-2003, 09:49 AM
Howdy...
What about keeping track of all the movieclips you've created into an array and when you need to delete those movieclips, you can use that array to do the job???
hello
I think you can use a for in type loop.
CyanBlue
04-01-2003, 10:35 AM
Yes, you can... The only problem is that you don't know which one is to be deleted or not... Maybe combine it with the array that contains all the names of movieclips that needs to be deleted???
sorry did not read the question properly, array would be fine but what about
Add a property called 'added' to all objects then set it to true as you dynamically add objects. Then use that as the test for deleting.
Depending what you do with the stuff you add but normally its depth is above design time stuff unless changed, so you could use that to determine what to delete in your for in loop? I would need to lookup some stuff to do the code for that and to be sure that would work.
|
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.