ActionScript 3 Delete an Object Function


/ Published in: ActionScript 3
Save to your folder(s)

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


Copy this code and paste it in your HTML
  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


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.