# Know if object is stage or movieclip

**URL:** <https://forum.kirupa.com/t/know-if-object-is-stage-or-movieclip/258228>\
**Category:** Uncategorized\
**Created:** [April 22, 2008, 9:03am UTC](https://forum.kirupa.com/t/know-if-object-is-stage-or-movieclip/258228 "2008-04-22T09:03:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pier25](https://avatars.discourse-cdn.com/v4/letter/p/4af34b/32.png) [@Pier25](https://forum.kirupa.com/u/Pier25)\
**Post date:** [April 22, 2008, 9:03am UTC](https://forum.kirupa.com/t/know-if-object-is-stage-or-movieclip/258228/1 "2008-04-22T09:03:27Z")

</div>

I’m trying to make a function for centering movieclips to other movieclips, or centering the movieclips to the stage. My problem is movieclips use \_width & \_height and the stage uses width & height without the underscore.

I’m passing the 2 objects as parameters to the function “center” (reference for centering, and the object I want to center), but I don’t know how to make the function know if I’m passing a movieclip or the stage.

I tried typeof which returns [object object]…

any ideas?

TIA!
