# Class object ReferenceError (please advise)

**URL:** <https://forum.kirupa.com/t/class-object-referenceerror-please-advise/304258>\
**Category:** flash\
**Created:** [February 4, 2010, 2:25pm UTC](https://forum.kirupa.com/t/class-object-referenceerror-please-advise/304258 "2010-02-04T14:25:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Wurzagg](https://avatars.discourse-cdn.com/v4/letter/w/50afbb/32.png) [@Wurzagg](https://forum.kirupa.com/u/Wurzagg)\
**Post date:** [February 4, 2010, 2:25pm UTC](https://forum.kirupa.com/t/class-object-referenceerror-please-advise/304258/1 "2010-02-04T14:25:17Z")

</div>

I’m building a game which makes use of a few extended classes. I’ve recently made a few changes in the way the graphics are ordered and am now running into problems, namely:  
_ReferenceError: Error #1069: Property grab not found on flash.display.Sprite and there is no default value.  
at DraggableSprite/grabObject()  
ReferenceError: Error #1069: Property drop not found on flash.display.Sprite and there is no default value.  
at DraggableSprite/dropObject()_

The general structure is as follows (’\>’ means extends) :  
MovieClip \> DraggableSprite \> PlantPart \> Seed or Flower.

DraggableSprite manages dragging/dropping objects with the mouse. It contains the offending lines of code being:

```auto
private function grabObject(evt:MouseEvent)
        {
            trace("grabTarget: "+evt.target.name);
            if (this._draggable)
            {
                _origX = evt.target.x;
                _origY = evt.target.y;
                parent.addChild(this);
                evt.target.startDrag();
               **evt.target.grab(evt.target);**
            }
        }
        
        private function dropObject(evt:MouseEvent)
        {
            trace("dropTarget: "+evt.target.name);
            evt.target.stopDrag();
            **evt.target.drop(evt.target.dropTarget);**
        }

```

The Seed and Flower classes contain a public ‘grab’ and ‘drop’ function which manage some different effects of being picked up and dropped, but the code seems to stop short at the PlantPart class and register a sprite it contains as the ‘evt.target’. I added this intermediate sprite to overcome a colission problem with the mouse. The sprite functions as a dragbox, while the Seed and Flower graphics offer visual feedback.

I think I’m overlooking a simple logical step, but I just can’t seem to find it. I hope someone understands the problem and can help me solve it.
