# Test for prototype?

**URL:** <https://forum.kirupa.com/t/test-for-prototype/189834>\
**Category:** Uncategorized\
**Created:** [June 6, 2006, 3:10pm UTC](https://forum.kirupa.com/t/test-for-prototype/189834 "2006-06-06T15:10:06Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![flashpipe](https://avatars.discourse-cdn.com/v4/letter/f/839c29/32.png) [@flashpipe](https://forum.kirupa.com/u/flashpipe)\
**Post date:** [June 6, 2006, 3:10pm UTC](https://forum.kirupa.com/t/test-for-prototype/189834/1 "2006-06-06T15:10:06Z")

</div>

I’m using the following code to set a prototype for hitTest within a loaded mc. It works great the first time, but I need to test to see if it’s been called because it doesn’t work if the code gets called on successive loads…

```auto
 MovieClip.prototype.oldHitTest = MovieClip.prototype.hitTest;
        MovieClip.prototype.hitTest = function(x, y, sf) {
            var obj = {x:x, y:y};
            this._parent._parent.localToGlobal(obj);
            return this.oldHitTest(obj.x, obj.y, sf);
        };

```

Is there a way to test to see if the prototype has been called before? I was setting a variable in the \_parent movie initially, but I can’t do that now so I need to test to see if the prototype has been called…

Thanks!!!
