Posted By

scottwatkins on 04/07/11


Tagged

object actionscript delete as3


Versions (?)

ActionScript 3 Delete an Object Function


 / Published in: ActionScript 3
 

This function will delete and object and mark it for deletion with gc.

  1. /**
  2.  * _deleteObject function
  3.  * Removes the specified object from the parent object and nulls the object.
  4.  *
  5.  * @param obj:Object The specific object to remove
  6.  */
  7. private function _deleteObject(obj:Object):void
  8. {
  9. if (obj.parent)
  10. obj.parent.removeChild(obj);
  11. obj = null;
  12. }

Report this snippet  

You need to login to post a comment.