3 Replies Latest reply on Oct 22, 2008 12:34 AM by Peter Lorent

    Removing an object from inside the object class?

    Handycam Level 1
      I have an class with event listeners wired for dragging the object. I want to add an event to this class to delete the object from the stage.

      I create the object like so:
      private function makeItem():void {
      var foo:ItemImage = new ItemImage("assets/model810.png");

      I know I can remove it from the parent app with picArea.removeChild(foo), but how do I do it from with the class?

      If I add an event listener like: this.addEventListener(MouseEvent.DOUBLE_CLICK, deleteMe); inside my class, what's the command for the instance to remove itself?