Hi everyone,
I’m a big fan of the Director class, as I use it in many of my own projects.
Last night I was answering a question in the forums about removing an entire display group (as well as it’s children), so I pasted the cleanGroups() function from the Director class and told them to use that.
Well, user FrankS kindly pointed out to me that the cleanGroups function (the one used in Director class) is not entirely efficient because there are some instances where display objects (not groups, but actual display objects) get left behind.
He explains it all in this post:
http://developer.anscamobile.com/forum/2011/03/06/remove-all-objects#comment-26557
And I’ve got a modified version of Director Class 1.2 you can replace your projects with that uses the modified cleanGroups function here:
Here’s exactly what was changed:
-
Added function: isDisplayObject() which is used by cleanGroups()
-
Modified cleanGroups to be more efficient.
-
Anywhere else in the module that calls cleanGroups(), I added a line directly below it to re-create the group that was cleaned (the cleanGroups will completely destroy whatever group it cleaned out).
@Ricardo Rauber: Please consider making these changes official in the next version release! (1.3?)
And special thanks to FrankS for actually providing the new cleanGroups() function (as well as the isDisplayObject() function).
[import]uid: 7849 topic_id: 7515 reply_id: 307515[/import]